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

Unified Diff: Source/core/inspector/InspectorAgent.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/CodeGeneratorInspectorStrings.py ('k') | Source/core/inspector/InspectorAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorAgent.h
diff --git a/Source/core/inspector/InspectorAgent.h b/Source/core/inspector/InspectorAgent.h
index a84d9b6b24db16590203bf2966ec1eb46d82ec1b..a800c0ef97d4dc1165d15a271604ce456142202c 100644
--- a/Source/core/inspector/InspectorAgent.h
+++ b/Source/core/inspector/InspectorAgent.h
@@ -51,12 +51,12 @@ class Page;
typedef String ErrorString;
-class InspectorAgent : public InspectorBaseAgent<InspectorAgent>, public InspectorBackendDispatcher::InspectorCommandHandler {
+class InspectorAgent : public InspectorBaseAgent, public InspectorBackendDispatcher::InspectorCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorAgent);
public:
- static PassOwnPtr<InspectorAgent> create(Page* page, InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state)
+ static PassRefPtr<InspectorAgent> create(Page* page, InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, InspectorState* state)
{
- return adoptPtr(new InspectorAgent(page, injectedScriptManager, instrumentingAgents, state));
+ return adoptRef(new InspectorAgent(page, injectedScriptManager, instrumentingAgents, state));
}
virtual ~InspectorAgent();
@@ -89,7 +89,7 @@ public:
void inspect(PassRefPtr<TypeBuilder::Runtime::RemoteObject> objectToInspect, PassRefPtr<InspectorObject> hints);
private:
- InspectorAgent(Page*, InjectedScriptManager*, InstrumentingAgents*, InspectorCompositeState*);
+ InspectorAgent(Page*, InjectedScriptManager*, InstrumentingAgents*, InspectorState*);
void unbindAllResources();
@@ -107,6 +107,22 @@ private:
InjectedScriptForOriginMap m_injectedScriptForOrigin;
};
+class InspectorAgentFactory : public InspectorBaseFactory<InspectorAgentFactory, InspectorAgent> {
+public:
+
+ static PassOwnPtr<InspectorAgentFactory> create(Page* page, InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState)
+ {
+ return adoptPtr(new InspectorAgentFactory(page, injectedScriptManager, instrumentingAgents, compositeState));
+ }
+
+protected:
+ InspectorAgentFactory(Page* page, InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState)
+ : InspectorBaseFactory<InspectorAgentFactory, InspectorAgent>("Inspector", instrumentingAgents, compositeState)
+ {
+ setAgent(InspectorAgent::create(page, injectedScriptManager, m_instrumentingAgents, m_state));
+ }
+};
+
} // namespace WebCore
#endif // !defined(InspectorAgent_h)
« no previous file with comments | « Source/core/inspector/CodeGeneratorInspectorStrings.py ('k') | Source/core/inspector/InspectorAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698