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

Unified Diff: Source/core/inspector/InspectorResourceAgent.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/InspectorResourceAgent.h ('k') | Source/core/inspector/InspectorRuntimeAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorResourceAgent.cpp
diff --git a/Source/core/inspector/InspectorResourceAgent.cpp b/Source/core/inspector/InspectorResourceAgent.cpp
index ada11581b383a5e57bff530dc0d08b80fc02a03c..7017b4287cc3cbc6a489c16fb00aef33c43fcb56 100644
--- a/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/Source/core/inspector/InspectorResourceAgent.cpp
@@ -723,8 +723,8 @@ void InspectorResourceAgent::didCommitLoad(Frame* frame, DocumentLoader* loader)
void InspectorResourceAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorResourceAgent);
- InspectorBaseAgent<InspectorResourceAgent>::reportMemoryUsage(memoryObjectInfo);
- info.addWeakPointer(m_pageAgent);
+ InspectorBaseAgent::reportMemoryUsage(memoryObjectInfo);
+ info.addWeakPointer(m_pageAgent.get());
info.addWeakPointer(m_client);
info.addWeakPointer(m_frontend);
info.addMember(m_userAgentOverride, "userAgentOverride");
@@ -733,8 +733,13 @@ void InspectorResourceAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInf
info.addMember(m_styleRecalculationInitiator, "styleRecalculationInitiator");
}
-InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client, InspectorCompositeState* state)
- : InspectorBaseAgent<InspectorResourceAgent>("Network", instrumentingAgents, state)
+PassRefPtr<InspectorResourceAgent> InspectorResourceAgent::create(InstrumentingAgents* instrumentingAgents, InspectorState* state, PassRefPtr<InspectorPageAgent> pageAgent, InspectorClient* client)
+{
+ return adoptRef(new InspectorResourceAgent(instrumentingAgents, state, pageAgent, client));
+}
+
+InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, PassRefPtr<InspectorPageAgent> pageAgent, InspectorClient* client)
+ : InspectorBaseAgent(instrumentingAgents, state)
, m_pageAgent(pageAgent)
, m_client(client)
, m_frontend(0)
@@ -744,5 +749,11 @@ InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentin
{
}
+InspectorResourceFactory::InspectorResourceFactory(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InspectorPageFactory* pageFactory, InspectorClient* client)
+ : InspectorBaseFactory<InspectorResourceFactory, InspectorResourceAgent>("Resource", instrumentingAgents, compositeState)
+{
+ setAgent(InspectorResourceAgent::create(m_instrumentingAgents, m_state, pageFactory->agent(), client));
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.h ('k') | Source/core/inspector/InspectorRuntimeAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698