Changeset 159308 in webkit
- Timestamp:
- Nov 14, 2013 1:30:48 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r159307 r159308 1 2013-11-14 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Simply generated domain dispatch methods for domains with few commands 4 https://bugs.webkit.org/show_bug.cgi?id=124374 5 6 Reviewed by Timothy Hatcher. 7 8 * inspector/CodeGeneratorInspector.py: 9 (Generator.go): 10 (Generator.process_command): 11 * inspector/CodeGeneratorInspectorStrings.py: 12 1 13 2013-11-14 Bear Travis <betravis@adobe.com> 2 14 -
trunk/Source/WebCore/inspector/CodeGeneratorInspector.py
r159289 r159308 2 2 # Copyright (c) 2011 Google Inc. All rights reserved. 3 3 # Copyright (c) 2012 Intel Corporation. All rights reserved. 4 # Copyright (c) 2013 Apple Inc. All Rights Reserved. 4 5 # 5 6 # Redistribution and use in source and binary forms, with or without … … 1732 1733 backend_dispatcher_constructor = string.Template(CodeGeneratorInspectorStrings.backend_dispatcher_constructor) 1733 1734 backend_dispatcher_dispatch_method = string.Template(CodeGeneratorInspectorStrings.backend_dispatcher_dispatch_method) 1735 backend_dispatcher_dispatch_method_simple = string.Template(CodeGeneratorInspectorStrings.backend_dispatcher_dispatch_method_simple) 1734 1736 backend_method = string.Template(CodeGeneratorInspectorStrings.backend_method) 1735 1737 frontend_method = string.Template(CodeGeneratorInspectorStrings.frontend_method) … … 1907 1909 backend_method_count = len(Generator.backend_method_implementation_list) 1908 1910 1911 dispatcher_if_chain = [] 1909 1912 dispatcher_commands_list = [] 1910 1913 if "commands" in json_domain: 1911 1914 for json_command in json_domain["commands"]: 1912 Generator.process_command(json_command, domain_name, agent_interface_name, dispatcher_name, dispatcher_ commands_list)1915 Generator.process_command(json_command, domain_name, agent_interface_name, dispatcher_name, dispatcher_if_chain, dispatcher_commands_list) 1913 1916 1914 1917 Generator.backend_handler_interface_list.append("protected:\n") … … 1926 1929 agentName=agent_interface_name)) 1927 1930 1928 Generator.backend_method_implementation_list.insert(backend_method_count + 1, Templates.backend_dispatcher_dispatch_method.substitute(None, 1929 domainName=domain_name, 1930 dispatcherName=dispatcher_name, 1931 dispatcherCommands="\n".join(dispatcher_commands_list))) 1931 if "commands" in json_domain and len(json_domain["commands"]) <= 5: 1932 Generator.backend_method_implementation_list.insert(backend_method_count + 1, Templates.backend_dispatcher_dispatch_method_simple.substitute(None, 1933 domainName=domain_name, 1934 dispatcherName=dispatcher_name, 1935 ifChain="\n".join(dispatcher_if_chain))) 1936 else: 1937 Generator.backend_method_implementation_list.insert(backend_method_count + 1, Templates.backend_dispatcher_dispatch_method.substitute(None, 1938 domainName=domain_name, 1939 dispatcherName=dispatcher_name, 1940 dispatcherCommands="\n".join(dispatcher_commands_list))) 1932 1941 1933 1942 if domain_guard: … … 1985 1994 1986 1995 @staticmethod 1987 def process_command(json_command, domain_name, agent_interface_name, dispatcher_name, dispatcher_ commands_list):1996 def process_command(json_command, domain_name, agent_interface_name, dispatcher_name, dispatcher_if_chain, dispatcher_commands_list): 1988 1997 json_command_name = json_command["name"] 1989 1998 … … 1996 2005 Generator.backend_handler_interface_list.append(" virtual void %s(ErrorString*" % json_command_name) 1997 2006 2007 if not dispatcher_if_chain: 2008 dispatcher_if_chain.append(" if (method == \"%s\")" % json_command_name) 2009 else: 2010 dispatcher_if_chain.append(" else if (method == \"%s\")" % json_command_name) 2011 dispatcher_if_chain.append(" %s(callId, *message.get());" % json_command_name) 1998 2012 dispatcher_commands_list.append(" { \"%s\", &%s::%s }," % (json_command_name, dispatcher_name, json_command_name)) 1999 2013 -
trunk/Source/WebCore/inspector/CodeGeneratorInspectorStrings.py
r159289 r159308 1 1 # Copyright (c) 2013 Google Inc. All rights reserved. 2 # Copyright (c) 2013 Apple Inc. All Rights Reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 54 55 """) 55 56 57 backend_dispatcher_dispatch_method_simple = ( 58 """void ${dispatcherName}::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message) 59 { 60 Ref<${dispatcherName}> protect(*this); 61 62 ${ifChain} 63 else 64 m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, String("'") + "${domainName}" + '.' + method + "' was not found"); 65 } 66 """) 67 56 68 backend_dispatcher_dispatch_method = ( 57 69 """void ${dispatcherName}::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
Note: See TracChangeset
for help on using the changeset viewer.