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

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: 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/PageConsoleAgent.cpp
diff --git a/Source/core/inspector/PageConsoleAgent.cpp b/Source/core/inspector/PageConsoleAgent.cpp
index e5edadf47d856e7ac5d56a55e5eb0e49b1973f04..256c8bdc54fec5ff88cddb2ee788cb1e5fe519f6 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)));
}
+PageConsoleController::PageConsoleController(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InjectedScriptManager* injectedScriptManager, InspectorDOMController* domController)
+ : InspectorConsoleController(instrumentingAgents, compositeState)
+{
+ setAgent(PageConsoleAgent::create(m_instrumentingAgents, m_state, injectedScriptManager, domController->getAgent()));
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698