Index: Source/core/inspector/InspectorDOMAgent.h |
diff --git a/Source/core/inspector/InspectorDOMAgent.h b/Source/core/inspector/InspectorDOMAgent.h |
index 912fdb6b9138caba9590c6539627c4e54b5d7615..a441e103aece8e31e5ffb4d1e9d7cd80d083f628 100644 |
--- a/Source/core/inspector/InspectorDOMAgent.h |
+++ b/Source/core/inspector/InspectorDOMAgent.h |
@@ -62,6 +62,7 @@ class InspectorFrontend; |
class InspectorHistory; |
class InspectorOverlay; |
class InspectorPageAgent; |
+class InspectorPageFactory; |
class HTMLElement; |
class InspectorState; |
class InstrumentingAgents; |
@@ -91,7 +92,7 @@ struct EventListenerInfo { |
const EventListenerVector eventListenerVector; |
}; |
-class InspectorDOMAgent : public InspectorBaseAgent<InspectorDOMAgent>, public InspectorBackendDispatcher::DOMCommandHandler { |
+class InspectorDOMAgent : public InspectorBaseAgent, public InspectorBackendDispatcher::DOMCommandHandler { |
WTF_MAKE_NONCOPYABLE(InspectorDOMAgent); |
public: |
struct DOMListener { |
@@ -103,14 +104,11 @@ public: |
virtual void didModifyDOMAttr(Element*) = 0; |
}; |
- static PassOwnPtr<InspectorDOMAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorCompositeState* inspectorState, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClient* client) |
- { |
- return adoptPtr(new InspectorDOMAgent(instrumentingAgents, pageAgent, inspectorState, injectedScriptManager, overlay, client)); |
- } |
+ static PassRefPtr<InspectorDOMAgent> create(InstrumentingAgents*, InspectorState*, PassRefPtr<InspectorPageAgent>, InjectedScriptManager*, InspectorOverlay*, InspectorClient*); |
static String toErrorString(const ExceptionCode&); |
- ~InspectorDOMAgent(); |
+ virtual ~InspectorDOMAgent(); |
virtual void setFrontend(InspectorFrontend*); |
virtual void clearFrontend(); |
@@ -206,11 +204,8 @@ public: |
Element* assertElement(ErrorString*, int nodeId); |
Document* assertDocument(ErrorString*, int nodeId); |
- // Methods called from other agents. |
- InspectorPageAgent* pageAgent() { return m_pageAgent; } |
- |
private: |
- InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorCompositeState*, InjectedScriptManager*, InspectorOverlay*, InspectorClient*); |
+ InspectorDOMAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<InspectorPageAgent>, InjectedScriptManager*, InspectorOverlay*, InspectorClient*); |
void setSearchingForNode(ErrorString*, bool enabled, InspectorObject* highlightConfig); |
PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, InspectorObject* highlightInspectorObject); |
@@ -244,7 +239,7 @@ private: |
void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<InspectorObject>* color, const RefPtr<InspectorObject>* outlineColor); |
- InspectorPageAgent* m_pageAgent; |
+ RefPtr<InspectorPageAgent> m_pageAgent; |
InjectedScriptManager* m_injectedScriptManager; |
InspectorOverlay* m_overlay; |
InspectorClient* m_client; |
@@ -273,6 +268,18 @@ private: |
}; |
+class InspectorDOMFactory : public InspectorBaseFactory<InspectorDOMFactory, InspectorDOMAgent> { |
+public: |
+ |
+ static PassOwnPtr<InspectorDOMFactory> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InspectorPageFactory* pageFactory, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClient* client) |
+ { |
+ return adoptPtr(new InspectorDOMFactory(instrumentingAgents, compositeState, pageFactory, injectedScriptManager, overlay, client)); |
+ } |
+ |
+protected: |
+ InspectorDOMFactory(InstrumentingAgents*, InspectorCompositeState*, InspectorPageFactory*, InjectedScriptManager*, InspectorOverlay*, InspectorClient*); |
+}; |
+ |
} // namespace WebCore |
#endif // !defined(InspectorDOMAgent_h) |