Index: Source/core/inspector/InspectorProfilerAgent.cpp |
diff --git a/Source/core/inspector/InspectorProfilerAgent.cpp b/Source/core/inspector/InspectorProfilerAgent.cpp |
index d84ef175b8d4ddd125f61f305c9873f97df4ade3..566e6f4462e81f0059f1084a367a0ace2b4ebbd1 100644 |
--- a/Source/core/inspector/InspectorProfilerAgent.cpp |
+++ b/Source/core/inspector/InspectorProfilerAgent.cpp |
@@ -64,13 +64,13 @@ static const char profileHeadersRequested[] = "profileHeadersRequested"; |
static const char* const userInitiatedProfileName = "org.webkit.profiles.user-initiated"; |
static const char* const CPUProfileType = "CPU"; |
-PassOwnPtr<InspectorProfilerAgent> InspectorProfilerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, InspectorCompositeState* inspectorState, InjectedScriptManager* injectedScriptManager) |
+PassRefPtr<InspectorProfilerAgent> InspectorProfilerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorState* inspectorState, PassRefPtr<InspectorConsoleAgent> consoleAgent, InjectedScriptManager* injectedScriptManager) |
{ |
- return adoptPtr(new InspectorProfilerAgent(instrumentingAgents, consoleAgent, inspectorState, injectedScriptManager)); |
+ return adoptRef(new InspectorProfilerAgent(instrumentingAgents, inspectorState, consoleAgent, injectedScriptManager)); |
} |
-InspectorProfilerAgent::InspectorProfilerAgent(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, InspectorCompositeState* inspectorState, InjectedScriptManager* injectedScriptManager) |
- : InspectorBaseAgent<InspectorProfilerAgent>("Profiler", instrumentingAgents, inspectorState) |
+InspectorProfilerAgent::InspectorProfilerAgent(InstrumentingAgents* instrumentingAgents, InspectorState* inspectorState, PassRefPtr<InspectorConsoleAgent> consoleAgent, InjectedScriptManager* injectedScriptManager) |
+ : InspectorBaseAgent(instrumentingAgents, inspectorState) |
, m_consoleAgent(consoleAgent) |
, m_injectedScriptManager(injectedScriptManager) |
, m_frontend(0) |
@@ -276,7 +276,7 @@ void InspectorProfilerAgent::toggleRecordButton(bool isProfiling) |
void InspectorProfilerAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const |
{ |
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorProfilerAgent); |
- InspectorBaseAgent<InspectorProfilerAgent>::reportMemoryUsage(memoryObjectInfo); |
+ InspectorBaseAgent::reportMemoryUsage(memoryObjectInfo); |
info.addMember(m_consoleAgent, "consoleAgent"); |
info.addMember(m_injectedScriptManager, "injectedScriptManager"); |
info.addWeakPointer(m_frontend); |
@@ -305,5 +305,11 @@ void InspectorProfilerAgent::didProcessTask() |
m_previousTaskEndTime = WTF::monotonicallyIncreasingTime(); |
} |
+InspectorProfilerFactory::InspectorProfilerFactory(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InspectorConsoleFactory* consoleFactory, InjectedScriptManager* injectedScriptManager) |
+ : InspectorBaseFactory<InspectorProfilerFactory, InspectorProfilerAgent>("Profiler", instrumentingAgents, compositeState) |
+{ |
+ setAgent(InspectorProfilerAgent::create(m_instrumentingAgents, m_state, consoleFactory->agent(), injectedScriptManager)); |
+} |
+ |
} // namespace WebCore |