Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1382)

Unified Diff: core/inspector/CodeGeneratorInspector.py

Issue 206333004: Update IDL to 1847 (Closed) Base URL: https://dart.googlecode.com/svn/third_party/WebCore
Patch Set: Add new files Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/html/track/TextTrackList.idl ('k') | core/inspector/CodeGeneratorInspectorStrings.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/inspector/CodeGeneratorInspector.py
diff --git a/core/inspector/CodeGeneratorInspector.py b/core/inspector/CodeGeneratorInspector.py
index 163ce99c1f9270361693af692f52d18ac79d4127..342b5a231e23c3fe39608e5c897926f85540e39f 100755
--- a/core/inspector/CodeGeneratorInspector.py
+++ b/core/inspector/CodeGeneratorInspector.py
@@ -49,11 +49,9 @@ TYPE_NAME_FIX_MAP = {
TYPES_WITH_RUNTIME_CAST_SET = frozenset(["Runtime.RemoteObject", "Runtime.PropertyDescriptor", "Runtime.InternalPropertyDescriptor",
"Debugger.FunctionDetails", "Debugger.CallFrame", "Debugger.Location",
- "Canvas.TraceLog", "Canvas.ResourceState",
- # This should be a temporary hack. TimelineEvent should be created via generated C++ API.
- "Timeline.TimelineEvent"])
+ "Canvas.TraceLog", "Canvas.ResourceState"])
-TYPES_WITH_OPEN_FIELD_LIST_SET = frozenset(["Timeline.TimelineEvent",
+TYPES_WITH_OPEN_FIELD_LIST_SET = frozenset([
# InspectorStyleSheet not only creates this property but wants to read it and modify it.
"CSS.CSSProperty",
# InspectorResourceAgent needs to update mime-type.
@@ -1889,11 +1887,13 @@ class Generator:
Generator.method_handler_list.append(" &InspectorBackendDispatcherImpl::%s_%s," % (domain_name, json_command_name))
Generator.backend_method_declaration_list.append(" void %s_%s(long callId, JSONObject* requestMessageObject);" % (domain_name, json_command_name))
+ backend_agent_interface_list = [] if "redirect" in json_command else Generator.backend_agent_interface_list
+
ad_hoc_type_output = []
- Generator.backend_agent_interface_list.append(ad_hoc_type_output)
+ backend_agent_interface_list.append(ad_hoc_type_output)
ad_hoc_type_writer = Writer(ad_hoc_type_output, " ")
- Generator.backend_agent_interface_list.append(" virtual void %s(ErrorString*" % json_command_name)
+ backend_agent_interface_list.append(" virtual void %s(ErrorString*" % json_command_name)
method_in_code = ""
method_out_code = ""
@@ -1908,7 +1908,7 @@ class Generator:
error_type_model = error_type_binding.get_type_model().get_optional()
error_annotated_type = error_type_model.get_command_return_pass_model().get_output_parameter_type()
agent_call_param_list.append(", %serrorData" % error_type_model.get_command_return_pass_model().get_output_argument_prefix())
- Generator.backend_agent_interface_list.append(", %s errorData" % error_annotated_type)
+ backend_agent_interface_list.append(", %s errorData" % error_annotated_type)
method_in_code += " %s errorData;\n" % error_type_model.get_command_return_pass_model().get_return_var_type()
setter_argument = error_type_model.get_command_return_pass_model().get_output_to_raw_expression() % "errorData"
@@ -1962,7 +1962,7 @@ class Generator:
method_in_code += code
agent_call_param_list.append(param)
- Generator.backend_agent_interface_list.append(", %s in_%s" % (formal_param_type_pattern % non_optional_type_model.get_command_return_pass_model().get_return_var_type(), json_param_name))
+ backend_agent_interface_list.append(", %s in_%s" % (formal_param_type_pattern % non_optional_type_model.get_command_return_pass_model().get_return_var_type(), json_param_name))
if json_command.get("async") == True:
callback_name = Capitalizer.lower_camel_case_to_upper(json_command_name) + "Callback"
@@ -2007,7 +2007,7 @@ class Generator:
normal_response_cook_text += " if (!error.length()) \n"
normal_response_cook_text += " return;\n"
normal_response_cook_text += " callback->disable();\n"
- Generator.backend_agent_interface_list.append(", PassRefPtr<%s> callback" % callback_name)
+ backend_agent_interface_list.append(", PassRefPtr<%s> callback" % callback_name)
else:
if "returns" in json_command:
method_out_code += "\n"
@@ -2047,7 +2047,7 @@ class Generator:
if optional:
param_name = "opt_" + param_name
- Generator.backend_agent_interface_list.append(", %s %s" % (annotated_type, param_name))
+ backend_agent_interface_list.append(", %s %s" % (annotated_type, param_name))
response_cook_list.append(cook)
method_out_code += code
@@ -2058,9 +2058,15 @@ class Generator:
if len(normal_response_cook_text) != 0:
normal_response_cook_text = " if (!error.length()) {\n" + normal_response_cook_text + " }"
+ # Redirect to another agent's implementation.
+ agent_field = "m_" + agent_field_name
+ if "redirect" in json_command:
+ domain_fixes = DomainNameFixes.get_fixed_data(json_command.get("redirect"))
+ agent_field = "m_" + domain_fixes.agent_field_name
+
Generator.backend_method_implementation_list.append(Templates.backend_method.substitute(None,
domainName=domain_name, methodName=json_command_name,
- agentField="m_" + agent_field_name,
+ agentField=agent_field,
methodInCode=method_in_code,
methodOutCode=method_out_code,
agentCallParams="".join(agent_call_param_list),
@@ -2073,7 +2079,7 @@ class Generator:
Generator.backend_method_name_declaration_index_list.append(" %d," % Generator.backend_method_name_declaration_current_index)
Generator.backend_method_name_declaration_current_index += len(declaration_command_name) - 1
- Generator.backend_agent_interface_list.append(") = 0;\n")
+ backend_agent_interface_list.append(") = 0;\n")
class CallbackMethodStructTemplate:
@staticmethod
« no previous file with comments | « core/html/track/TextTrackList.idl ('k') | core/inspector/CodeGeneratorInspectorStrings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698