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

Unified Diff: Source/core/inspector/InspectorDOMAgent.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/InspectorController.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/core/inspector/InspectorController.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698