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

Unified Diff: Source/core/inspector/InspectorProfilerAgent.cpp

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 7 years, 6 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 | « Source/core/inspector/InspectorProfilerAgent.h ('k') | Source/core/inspector/InspectorResourceAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/inspector/InspectorProfilerAgent.h ('k') | Source/core/inspector/InspectorResourceAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698