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

Unified Diff: Source/core/inspector/InspectorPageAgent.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/InspectorMemoryAgent.cpp ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorPageAgent.h
diff --git a/Source/core/inspector/InspectorPageAgent.h b/Source/core/inspector/InspectorPageAgent.h
index af638d132d2a047189dd9a756de1ea09af5f4622..3bf7218f1f5212e008abc369458645891fcacc74 100644
--- a/Source/core/inspector/InspectorPageAgent.h
+++ b/Source/core/inspector/InspectorPageAgent.h
@@ -61,7 +61,7 @@ class SharedBuffer;
typedef String ErrorString;
-class InspectorPageAgent : public InspectorBaseAgent<InspectorPageAgent>, public InspectorBackendDispatcher::PageCommandHandler {
+class InspectorPageAgent : public InspectorBaseAgent, public InspectorBackendDispatcher::PageCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorPageAgent);
public:
enum ResourceType {
@@ -75,7 +75,7 @@ public:
OtherResource
};
- static PassOwnPtr<InspectorPageAgent> create(InstrumentingAgents*, Page*, InspectorCompositeState*, InjectedScriptManager*, InspectorClient*, InspectorOverlay*);
+ static PassRefPtr<InspectorPageAgent> create(InstrumentingAgents*, InspectorState*, Page*, InjectedScriptManager*, InspectorOverlay*, InspectorClient*);
static bool cachedResourceContent(CachedResource*, String* result, bool* base64Encoded);
static bool sharedBufferContent(PassRefPtr<SharedBuffer>, const String& textEncodingName, bool withBase64Encode, String* result);
@@ -174,7 +174,7 @@ public:
static DocumentLoader* assertDocumentLoader(ErrorString*, Frame*);
private:
- InspectorPageAgent(InstrumentingAgents*, Page*, InspectorCompositeState*, InjectedScriptManager*, InspectorClient*, InspectorOverlay*);
+ InspectorPageAgent(InstrumentingAgents*, InspectorState*, Page*, InjectedScriptManager*, InspectorOverlay*, InspectorClient*);
bool deviceMetricsChanged(int width, int height, double fontScaleFactor, bool fitWindow);
void updateViewMetrics(int, int, double, bool);
void updateTouchEventEmulationInPage(bool);
@@ -207,6 +207,22 @@ private:
};
+class InspectorPageFactory : public InspectorBaseFactory<InspectorPageFactory, InspectorPageAgent> {
+public:
+
+ static PassOwnPtr<InspectorPageFactory> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, Page* page, InjectedScriptManager* injectedScriptManager, InspectorOverlay* inspectorOverlay, InspectorClient* inspectorClient)
+ {
+ return adoptPtr(new InspectorPageFactory(instrumentingAgents, state, page, injectedScriptManager, inspectorOverlay, inspectorClient));
+ }
+
+protected:
+ InspectorPageFactory(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, Page* page, InjectedScriptManager* injectedScriptManager, InspectorOverlay* inspectorOverlay, InspectorClient* inspectorClient)
+ : InspectorBaseFactory<InspectorPageFactory, InspectorPageAgent>("Page", instrumentingAgents, compositeState)
+ {
+ setAgent(InspectorPageAgent::create(m_instrumentingAgents, m_state, page, injectedScriptManager, inspectorOverlay, inspectorClient));
+ }
+};
+
} // namespace WebCore
« no previous file with comments | « Source/core/inspector/InspectorMemoryAgent.cpp ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698