Chromium Code Reviews| Index: Source/core/inspector/InspectorAgent.h |
| diff --git a/Source/core/inspector/InspectorAgent.h b/Source/core/inspector/InspectorAgent.h |
| index a84d9b6b24db16590203bf2966ec1eb46d82ec1b..5120044611fc13521857d8376453f69a69d1a198 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) |
|
pfeldman
2013/06/18 15:36:06
Make agents ref-counted in a separate patch?
Vladislav Kaznacheev
2013/06/19 12:58:43
Discussed, agreed this is not worth it.
On 2013/06
|
| { |
| - 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 InspectorAgentController: public InspectorBaseController<InspectorAgentController, InspectorAgent> { |
|
pfeldman
2013/06/18 15:36:06
s/Controller/Factory/
Vladislav Kaznacheev
2013/06/19 12:58:43
Done.
|
| +public: |
| + |
| + static PassOwnPtr<InspectorAgentController> create(Page* page, InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState) |
| + { |
| + return adoptPtr(new InspectorAgentController(page, injectedScriptManager, instrumentingAgents, compositeState)); |
| + } |
| + |
| +protected: |
| + InspectorAgentController(Page* page, InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState) |
| + : InspectorBaseController<InspectorAgentController, InspectorAgent>("Inspector", instrumentingAgents, compositeState) |
| + { |
| + setAgent(InspectorAgent::create(page, injectedScriptManager, m_instrumentingAgents, m_state)); |
| + } |
| +}; |
| + |
| } // namespace WebCore |
| #endif // !defined(InspectorAgent_h) |