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

Unified Diff: Source/core/inspector/InspectorTimelineAgent.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
« no previous file with comments | « Source/core/inspector/InspectorRuntimeAgent.cpp ('k') | Source/core/inspector/InspectorTimelineAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorTimelineAgent.h
diff --git a/Source/core/inspector/InspectorTimelineAgent.h b/Source/core/inspector/InspectorTimelineAgent.h
index 2a35c564af61f63532e53df55646dbdfc7e856da..16e536e15e36acc5f8770618074eefe0bd0038be 100644
--- a/Source/core/inspector/InspectorTimelineAgent.h
+++ b/Source/core/inspector/InspectorTimelineAgent.h
@@ -55,9 +55,12 @@ class Frame;
class GraphicsContext;
class InspectorClient;
class InspectorDOMAgent;
+class InspectorDOMFactory;
class InspectorFrontend;
class InspectorMemoryAgent;
+class InspectorMemoryFactory;
class InspectorPageAgent;
+class InspectorPageFactory;
class InspectorState;
class InstrumentingAgents;
class IntRect;
@@ -99,7 +102,7 @@ private:
};
class InspectorTimelineAgent
- : public InspectorBaseAgent<InspectorTimelineAgent>,
+ : public InspectorBaseAgent,
public ScriptGCEventListener,
public InspectorBackendDispatcher::TimelineCommandHandler,
public PlatformInstrumentationClient {
@@ -107,12 +110,9 @@ class InspectorTimelineAgent
public:
enum InspectorType { PageInspector, WorkerInspector };
- static PassOwnPtr<InspectorTimelineAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorMemoryAgent* memoryAgent, InspectorDOMAgent* domAgent, InspectorCompositeState* state, InspectorType type, InspectorClient* client)
- {
- return adoptPtr(new InspectorTimelineAgent(instrumentingAgents, pageAgent, memoryAgent, domAgent, state, type, client));
- }
+ static PassRefPtr<InspectorTimelineAgent> create(InstrumentingAgents*, InspectorState*, PassRefPtr<InspectorPageAgent>, PassRefPtr<InspectorMemoryAgent>, PassRefPtr<InspectorDOMAgent>, InspectorType, InspectorClient*);
- ~InspectorTimelineAgent();
+ virtual ~InspectorTimelineAgent();
virtual void setFrontend(InspectorFrontend*);
virtual void clearFrontend();
@@ -225,7 +225,7 @@ private:
size_t usedHeapSizeAtStart;
};
- InspectorTimelineAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorMemoryAgent*, InspectorDOMAgent*, InspectorCompositeState*, InspectorType, InspectorClient*);
+ InspectorTimelineAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<InspectorPageAgent>, PassRefPtr<InspectorMemoryAgent>, PassRefPtr<InspectorDOMAgent>, InspectorType, InspectorClient*);
void didFinishLoadingResource(unsigned long, bool didFail, double finishTime, Frame*);
@@ -255,9 +255,9 @@ private:
double timestamp();
Page* page();
- InspectorPageAgent* m_pageAgent;
- InspectorMemoryAgent* m_memoryAgent;
- InspectorDOMAgent* m_domAgent;
+ RefPtr<InspectorPageAgent> m_pageAgent;
+ RefPtr<InspectorMemoryAgent> m_memoryAgent;
+ RefPtr<InspectorDOMAgent> m_domAgent;
TimelineTimeConverter m_timeConverter;
InspectorFrontend::Timeline* m_frontend;
@@ -287,6 +287,18 @@ private:
unsigned m_styleRecalcElementCounter;
};
+class InspectorTimelineFactory : public InspectorBaseFactory<InspectorTimelineFactory, InspectorTimelineAgent> {
+public:
+
+ static PassOwnPtr<InspectorTimelineFactory> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InspectorPageFactory* pageFactory, InspectorMemoryFactory* memoryFactory, InspectorDOMFactory* domFactory, InspectorTimelineAgent::InspectorType type, InspectorClient* client)
+ {
+ return adoptPtr(new InspectorTimelineFactory(instrumentingAgents, compositeState, pageFactory, memoryFactory, domFactory, type, client));
+ }
+
+protected:
+ InspectorTimelineFactory(InstrumentingAgents*, InspectorCompositeState*, InspectorPageFactory*, InspectorMemoryFactory*, InspectorDOMFactory*, InspectorTimelineAgent::InspectorType, InspectorClient*);
+};
+
} // namespace WebCore
#endif // !defined(InspectorTimelineAgent_h)
« no previous file with comments | « Source/core/inspector/InspectorRuntimeAgent.cpp ('k') | Source/core/inspector/InspectorTimelineAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698