Index: core/inspector/CodeGeneratorInstrumentation.py |
diff --git a/core/inspector/CodeGeneratorInstrumentation.py b/core/inspector/CodeGeneratorInstrumentation.py |
index 54e5ce8a4359084ecf615103864ac672b957d494..595812e12c40619542c47f27131298be390c2dd3 100755 |
--- a/core/inspector/CodeGeneratorInstrumentation.py |
+++ b/core/inspector/CodeGeneratorInstrumentation.py |
@@ -104,19 +104,12 @@ template_agent_call = string.Template(""" |
if (${agent_class}* agent = ${agent_fetch}) |
${maybe_return}agent->${name}(${params_agent});""") |
-template_agent_call_timeline_returns_cookie = string.Template(""" |
- int timelineAgentId = 0; |
- if (InspectorTimelineAgent* agent = agents->inspectorTimelineAgent()) { |
- if (agent->${name}(${params_agent})) |
- timelineAgentId = agent->id(); |
- }""") |
- |
- |
template_instrumenting_agents_h = string.Template("""// Code generated from InspectorInstrumentation.idl |
#ifndef InstrumentingAgentsInl_h |
#define InstrumentingAgentsInl_h |
+#include "core/CoreExport.h" |
#include "platform/heap/Handle.h" |
#include "wtf/FastAllocBase.h" |
#include "wtf/Noncopyable.h" |
@@ -127,16 +120,16 @@ namespace blink { |
${forward_list} |
-class InstrumentingAgents : public RefCountedWillBeGarbageCollectedFinalized<InstrumentingAgents> { |
+class CORE_EXPORT InstrumentingAgents : public RefCountedWillBeGarbageCollectedFinalized<InstrumentingAgents> { |
WTF_MAKE_NONCOPYABLE(InstrumentingAgents); |
- WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InstrumentingAgents); |
public: |
static PassRefPtrWillBeRawPtr<InstrumentingAgents> create() |
{ |
return adoptRefWillBeNoop(new InstrumentingAgents()); |
} |
~InstrumentingAgents() { } |
- void trace(Visitor*); |
+ DECLARE_TRACE(); |
void reset(); |
${accessor_list} |
@@ -162,7 +155,7 @@ InstrumentingAgents::InstrumentingAgents() |
{ |
} |
-void InstrumentingAgents::trace(Visitor* visitor) |
+DEFINE_TRACE(InstrumentingAgents) |
{ |
$trace_list |
} |
@@ -284,7 +277,7 @@ class Method: |
if "Inline=Custom" in self.options: |
return |
- header_lines.append("%s %sImpl(%s);" % ( |
+ header_lines.append("CORE_EXPORT %s %sImpl(%s);" % ( |
self.return_type, self.name, ", ".join(map(Parameter.to_str_class, self.params_impl)))) |
if "Inline=FastReturn" in self.options or "Inline=Forward" in self.options: |
@@ -328,20 +321,18 @@ class Method: |
body_lines += map(self.generate_agent_call, self.agents) |
if self.returns_cookie: |
- if "Timeline" in self.agents: |
- timeline_agent_id = "timelineAgentId" |
- else: |
- timeline_agent_id = "0" |
- body_lines.append("\n return InspectorInstrumentationCookie(agents, %s);" % timeline_agent_id) |
+ body_lines.append("\n return InspectorInstrumentationCookie(agents);") |
elif self.returns_value: |
body_lines.append("\n return %s;" % self.default_return_value) |
- cpp_lines.append(template_outofline.substitute( |
+ generated_outofline = template_outofline.substitute( |
None, |
return_type=self.return_type, |
name=self.name, |
params_impl=", ".join(map(Parameter.to_str_class_and_name, self.params_impl)), |
- impl_lines="".join(body_lines))) |
+ impl_lines="".join(body_lines)) |
+ if generated_outofline not in cpp_lines: |
+ cpp_lines.append(generated_outofline) |
def generate_agent_call(self, agent): |
agent_class, agent_getter = agent_getter_signature(agent) |
@@ -349,15 +340,10 @@ class Method: |
leading_param_name = self.params_impl[0].name |
if not self.accepts_cookie: |
agent_fetch = "%s->%s()" % (leading_param_name, agent_getter) |
- elif agent == "Timeline": |
- agent_fetch = "retrieveTimelineAgent(%s)" % leading_param_name |
else: |
agent_fetch = "%s.instrumentingAgents()->%s()" % (leading_param_name, agent_getter) |
- if agent == "Timeline" and self.returns_cookie: |
- template = template_agent_call_timeline_returns_cookie |
- else: |
- template = template_agent_call |
+ template = template_agent_call |
if not self.returns_value or self.returns_cookie: |
maybe_return = "" |
@@ -440,9 +426,11 @@ def generate_param_name(param_type): |
def agent_class_name(agent): |
- custom_agent_names = ["PageDebugger", "PageRuntime", "WorkerRuntime"] |
+ custom_agent_names = ["PageDebugger", "PageRuntime", "WorkerRuntime", "PageConsole"] |
if agent in custom_agent_names: |
return "%sAgent" % agent |
+ if agent == "AsyncCallTracker": |
+ return agent |
return "Inspector%sAgent" % agent |
@@ -524,6 +512,7 @@ def generate(input_path, output_dir): |
for agent in used_agents: |
cpp_includes.append(include_inspector_header(agent_class_name(agent))) |
cpp_includes.append(include_header("InstrumentingAgentsInl")) |
+ cpp_includes.append(include_header("core/CoreExport")) |
cpp_includes.sort() |
instrumenting_agents_header, instrumenting_agents_cpp = generate_instrumenting_agents(used_agents) |