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

Unified Diff: Source/core/inspector/InspectorMemoryAgent.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/InspectorLayerTreeAgent.cpp ('k') | Source/core/inspector/InspectorMemoryAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorMemoryAgent.h
diff --git a/Source/core/inspector/InspectorMemoryAgent.h b/Source/core/inspector/InspectorMemoryAgent.h
index 0f580c34bb4331c225f86bf29d3c8aa7cc6f6ebb..ed510582db80d7b15980f791f4676bc7881d7ef3 100644
--- a/Source/core/inspector/InspectorMemoryAgent.h
+++ b/Source/core/inspector/InspectorMemoryAgent.h
@@ -47,14 +47,14 @@ class Page;
typedef String ErrorString;
-class InspectorMemoryAgent : public InspectorBaseAgent<InspectorMemoryAgent>, public InspectorBackendDispatcher::MemoryCommandHandler {
+class InspectorMemoryAgent : public InspectorBaseAgent, public InspectorBackendDispatcher::MemoryCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorMemoryAgent);
public:
- typedef Vector<OwnPtr<InspectorBaseAgentInterface> > InspectorAgents;
+ typedef Vector<OwnPtr<InspectorBaseAgent> > InspectorAgents;
- static PassOwnPtr<InspectorMemoryAgent> create(InstrumentingAgents* instrumentingAgents, InspectorClient* client, InspectorCompositeState* state, Page* page)
+ static PassRefPtr<InspectorMemoryAgent> create(InstrumentingAgents* instrumentingAgents, InspectorClient* client, InspectorState* state, Page* page)
{
- return adoptPtr(new InspectorMemoryAgent(instrumentingAgents, client, state, page));
+ return adoptRef(new InspectorMemoryAgent(instrumentingAgents, client, state, page));
}
virtual ~InspectorMemoryAgent();
@@ -69,7 +69,7 @@ public:
virtual void clearFrontend();
private:
- InspectorMemoryAgent(InstrumentingAgents*, InspectorClient*, InspectorCompositeState*, Page*);
+ InspectorMemoryAgent(InstrumentingAgents*, InspectorClient*, InspectorState*, Page*);
PassRefPtr<InspectorObject> getProcessMemoryDistributionImpl(bool reportGraph, HashMap<String, size_t>* memoryInfo);
@@ -78,6 +78,22 @@ private:
InspectorFrontend::Memory* m_frontend;
};
+class InspectorMemoryFactory : public InspectorBaseFactory<InspectorMemoryFactory, InspectorMemoryAgent> {
+public:
+
+ static PassOwnPtr<InspectorMemoryFactory> create(InstrumentingAgents* instrumentingAgents, InspectorClient* client, InspectorCompositeState* compositeState, Page* page)
+ {
+ return adoptPtr(new InspectorMemoryFactory(instrumentingAgents, client, compositeState, page));
+ }
+
+protected:
+ InspectorMemoryFactory(InstrumentingAgents* instrumentingAgents, InspectorClient* client, InspectorCompositeState* compositeState, Page* page)
+ : InspectorBaseFactory<InspectorMemoryFactory, InspectorMemoryAgent>("Memory", instrumentingAgents, compositeState)
+ {
+ setAgent(InspectorMemoryAgent::create(m_instrumentingAgents, client, m_state, page));
+ }
+};
+
} // namespace WebCore
#endif // !defined(InspectorMemoryAgent_h)
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.cpp ('k') | Source/core/inspector/InspectorMemoryAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698