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

Unified Diff: third_party/WebKit/Source/core/inspector/CodeGeneratorInstrumentation.py

Issue 1455943002: [Oilpan] Prepare full definition of classes before using Member (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CORE_EXPORT Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/inspector/CodeGeneratorInstrumentation.py
diff --git a/third_party/WebKit/Source/core/inspector/CodeGeneratorInstrumentation.py b/third_party/WebKit/Source/core/inspector/CodeGeneratorInstrumentation.py
index 741029c8c77a081678e790adf3a5e2401af40850..54d82dd6851a1f1329f974bc7072c3de4605005f 100755
--- a/third_party/WebKit/Source/core/inspector/CodeGeneratorInstrumentation.py
+++ b/third_party/WebKit/Source/core/inspector/CodeGeneratorInstrumentation.py
@@ -145,9 +145,20 @@ ${member_list}
#endif // !defined(InstrumentingAgentsInl_h)
""")
-template_instrumenting_agent_accessor = string.Template("""
- ${class_name}* ${getter_name}() const { return ${member_name}; }
- void set${class_name}(${class_name}* agent) { ${member_name} = agent; }""")
+template_instrumenting_agent_accessor_prompt = string.Template("""
+ ${class_name}* ${getter_name}() const;
+ void set${class_name}(${class_name}* agent);""")
+
+template_instrumenting_agent_accessor_impl = string.Template("""
+${class_name}* InstrumentingAgents::${getter_name}() const
+{
+ return ${member_name};
+}
+
+void InstrumentingAgents::set${class_name}(${class_name}* agent)
+{
+ ${member_name} = agent;
+}""")
template_instrumenting_agents_cpp = string.Template("""
InstrumentingAgents::InstrumentingAgents()
@@ -163,7 +174,9 @@ DEFINE_TRACE(InstrumentingAgents)
void InstrumentingAgents::reset()
{
$reset_list
-}""")
+}
+
+${accessor_list}""")
@@ -452,6 +465,7 @@ def generate_instrumenting_agents(used_agents):
forward_list = []
accessor_list = []
+ accessor_impl_list = []
member_list = []
init_list = []
trace_list = []
@@ -462,7 +476,11 @@ def generate_instrumenting_agents(used_agents):
member_name = "m_" + getter_name
forward_list.append("class %s;" % class_name)
- accessor_list.append(template_instrumenting_agent_accessor.substitute(
+ accessor_list.append(template_instrumenting_agent_accessor_prompt.substitute(
+ None,
+ class_name=class_name,
+ getter_name=getter_name))
+ accessor_impl_list.append(template_instrumenting_agent_accessor_impl.substitute(
None,
class_name=class_name,
getter_name=getter_name,
@@ -474,6 +492,7 @@ def generate_instrumenting_agents(used_agents):
forward_list.sort()
accessor_list.sort()
+ accessor_impl_list.sort()
member_list.sort()
init_list.sort()
trace_list.sort()
@@ -489,7 +508,8 @@ def generate_instrumenting_agents(used_agents):
None,
init_list="\n , ".join(init_list),
trace_list="\n ".join(trace_list),
- reset_list="\n ".join(reset_list))
+ reset_list="\n ".join(reset_list),
+ accessor_list="\n".join(accessor_impl_list))
return header_lines, cpp_lines
« no previous file with comments | « third_party/WebKit/Source/core/html/track/TrackBase.cpp ('k') | third_party/WebKit/Source/core/inspector/InjectedScriptHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698