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

Unified Diff: Source/core/inspector/PageConsoleAgent.cpp

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/PageConsoleAgent.h ('k') | Source/core/inspector/PageDebuggerAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/PageConsoleAgent.cpp
diff --git a/Source/core/inspector/PageConsoleAgent.cpp b/Source/core/inspector/PageConsoleAgent.cpp
index e5edadf47d856e7ac5d56a55e5eb0e49b1973f04..d3aecc14a2ae6afbc61004292d4c584c8f872144 100644
--- a/Source/core/inspector/PageConsoleAgent.cpp
+++ b/Source/core/inspector/PageConsoleAgent.cpp
@@ -39,7 +39,12 @@
namespace WebCore {
-PageConsoleAgent::PageConsoleAgent(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, InjectedScriptManager* injectedScriptManager, InspectorDOMAgent* domAgent)
+PassRefPtr<PageConsoleAgent> PageConsoleAgent::create(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager, PassRefPtr<InspectorDOMAgent> domAgent)
+{
+ return adoptRef(new PageConsoleAgent(instrumentingAgents, state, injectedScriptManager, domAgent));
+}
+
+PageConsoleAgent::PageConsoleAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager, PassRefPtr<InspectorDOMAgent> domAgent)
: InspectorConsoleAgent(instrumentingAgents, state, injectedScriptManager)
, m_inspectorDOMAgent(domAgent)
{
@@ -84,4 +89,10 @@ void PageConsoleAgent::addInspectedNode(ErrorString* errorString, int nodeId)
m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(new InspectableNode(node)));
}
+PageConsoleFactory::PageConsoleFactory(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InjectedScriptManager* injectedScriptManager, InspectorDOMFactory* domFactory)
+ : InspectorConsoleFactory(instrumentingAgents, compositeState)
+{
+ setAgent(PageConsoleAgent::create(m_instrumentingAgents, m_state, injectedScriptManager, domFactory->agent()));
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/inspector/PageConsoleAgent.h ('k') | Source/core/inspector/PageDebuggerAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698