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

Unified Diff: Source/core/inspector/InspectorHeapProfilerAgent.h

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
Index: Source/core/inspector/InspectorHeapProfilerAgent.h
diff --git a/Source/core/inspector/InspectorHeapProfilerAgent.h b/Source/core/inspector/InspectorHeapProfilerAgent.h
index 03ac5603bde46713a36dc142cf525d6579f03c77..160678db8e3960c949ee2f420012fd411163ab0f 100644
--- a/Source/core/inspector/InspectorHeapProfilerAgent.h
+++ b/Source/core/inspector/InspectorHeapProfilerAgent.h
@@ -51,10 +51,10 @@ class ScriptProfile;
typedef String ErrorString;
-class InspectorHeapProfilerAgent : public InspectorBaseAgent<InspectorHeapProfilerAgent>, public InspectorBackendDispatcher::HeapProfilerCommandHandler {
+class InspectorHeapProfilerAgent : public InspectorBaseAgent, public InspectorBackendDispatcher::HeapProfilerCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorHeapProfilerAgent); WTF_MAKE_FAST_ALLOCATED;
public:
- static PassOwnPtr<InspectorHeapProfilerAgent> create(InstrumentingAgents*, InspectorCompositeState*, InjectedScriptManager*);
+ static PassRefPtr<InspectorHeapProfilerAgent> create(InstrumentingAgents*, InspectorState*, InjectedScriptManager*);
virtual ~InspectorHeapProfilerAgent();
virtual void collectGarbage(ErrorString*);
@@ -82,7 +82,7 @@ private:
class HeapStatsStream;
class HeapStatsUpdateTask;
- InspectorHeapProfilerAgent(InstrumentingAgents*, InspectorCompositeState*, InjectedScriptManager*);
+ InspectorHeapProfilerAgent(InstrumentingAgents*, InspectorState*, InjectedScriptManager*);
typedef HashMap<unsigned, RefPtr<ScriptHeapSnapshot> > IdToHeapSnapshotMap;
@@ -99,6 +99,22 @@ private:
OwnPtr<HeapStatsUpdateTask> m_heapStatsUpdateTask;
};
+class InspectorHeapProfilerFactory : public InspectorBaseFactory<InspectorHeapProfilerFactory, InspectorHeapProfilerAgent> {
+public:
+
+ static PassOwnPtr<InspectorHeapProfilerFactory> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InjectedScriptManager* injectedScriptManager)
+ {
+ return adoptPtr(new InspectorHeapProfilerFactory(instrumentingAgents, compositeState, injectedScriptManager));
+ }
+
+protected:
+ InspectorHeapProfilerFactory(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InjectedScriptManager* injectedScriptManager)
+ : InspectorBaseFactory<InspectorHeapProfilerFactory, InspectorHeapProfilerAgent>("HeapProfiler", instrumentingAgents, compositeState)
+ {
+ setAgent(InspectorHeapProfilerAgent::create(m_instrumentingAgents, m_state, injectedScriptManager));
+ }
+};
+
} // namespace WebCore
« no previous file with comments | « Source/core/inspector/InspectorFileSystemAgent.cpp ('k') | Source/core/inspector/InspectorHeapProfilerAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698