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

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: Made InspectorBaseAgent RefCounted 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
Index: Source/core/inspector/InspectorDOMAgent.h
diff --git a/Source/core/inspector/InspectorDOMAgent.h b/Source/core/inspector/InspectorDOMAgent.h
index 912fdb6b9138caba9590c6539627c4e54b5d7615..6782a0d39167e36489f12820fd1a4797fe158870 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 InspectorPageController;
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,10 +104,7 @@ 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&);
@@ -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 InspectorDOMController: public InspectorBaseController<InspectorDOMController, InspectorDOMAgent> {
+public:
+
+ static PassOwnPtr<InspectorDOMController> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InspectorPageController* pageController, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClient* client)
+ {
+ return adoptPtr(new InspectorDOMController(instrumentingAgents, compositeState, pageController, injectedScriptManager, overlay, client));
+ }
+
+protected:
+ InspectorDOMController(InstrumentingAgents*, InspectorCompositeState*, InspectorPageController*, InjectedScriptManager*, InspectorOverlay*, InspectorClient*);
+};
+
} // namespace WebCore
#endif // !defined(InspectorDOMAgent_h)

Powered by Google App Engine
This is Rietveld 408576698