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

Unified Diff: Source/core/inspector/InspectorDOMStorageAgent.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/InspectorDOMStorageAgent.h ('k') | Source/core/inspector/InspectorDatabaseAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDOMStorageAgent.cpp
diff --git a/Source/core/inspector/InspectorDOMStorageAgent.cpp b/Source/core/inspector/InspectorDOMStorageAgent.cpp
index 01a45451ec40423cf3a148ba2117700901aadd95..c13e095da302395c96fc291b11698c4d6de2d70f 100644
--- a/Source/core/inspector/InspectorDOMStorageAgent.cpp
+++ b/Source/core/inspector/InspectorDOMStorageAgent.cpp
@@ -71,8 +71,13 @@ static bool hadException(ExceptionCode ec, ErrorString* errorString)
}
}
-InspectorDOMStorageAgent::InspectorDOMStorageAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorCompositeState* state)
- : InspectorBaseAgent<InspectorDOMStorageAgent>("DOMStorage", instrumentingAgents, state)
+PassRefPtr<InspectorDOMStorageAgent> InspectorDOMStorageAgent::create(InstrumentingAgents* instrumentingAgents, InspectorState* state, PassRefPtr<InspectorPageAgent> pageAgent)
+{
+ return adoptRef(new InspectorDOMStorageAgent(instrumentingAgents, state, pageAgent));
+}
+
+InspectorDOMStorageAgent::InspectorDOMStorageAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, PassRefPtr<InspectorPageAgent> pageAgent)
+ : InspectorBaseAgent(instrumentingAgents, state)
, m_pageAgent(pageAgent)
, m_frontend(0)
{
@@ -239,9 +244,15 @@ PassRefPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(ErrorString* e
void InspectorDOMStorageAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorDOMStorageAgent);
- InspectorBaseAgent<InspectorDOMStorageAgent>::reportMemoryUsage(memoryObjectInfo);
+ InspectorBaseAgent::reportMemoryUsage(memoryObjectInfo);
info.addWeakPointer(m_frontend);
}
+InspectorDOMStorageFactory::InspectorDOMStorageFactory(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InspectorPageFactory* pageFactory)
+ : InspectorBaseFactory<InspectorDOMStorageFactory, InspectorDOMStorageAgent>("DOMStorage", instrumentingAgents, compositeState)
+{
+ setAgent(InspectorDOMStorageAgent::create(m_instrumentingAgents, m_state, pageFactory->agent()));
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/inspector/InspectorDOMStorageAgent.h ('k') | Source/core/inspector/InspectorDatabaseAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698