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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp

Issue 1907663005: [DevTools] Move v8-related instrumentation from agents to InspectorSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1889533002
Patch Set: profiler agent restore starts instrumenting Created 4 years, 8 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: third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
index 8856807ec7da2871575e7b9589bf1e768a042ad4..91217f4052d867d0a52eb45d8c5beedf4ebe93f2 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
@@ -26,8 +26,10 @@ PassOwnPtr<V8InspectorSessionImpl> V8InspectorSessionImpl::create(V8DebuggerImpl
V8InspectorSessionImpl::V8InspectorSessionImpl(V8DebuggerImpl* debugger, int contextGroupId)
: m_contextGroupId(contextGroupId)
, m_debugger(debugger)
+ , m_client(nullptr)
, m_injectedScriptHost(InjectedScriptHost::create(debugger, this))
, m_customObjectFormatterEnabled(false)
+ , m_instrumentationCounter(0)
, m_runtimeAgent(adoptPtr(new V8RuntimeAgentImpl(this)))
, m_debuggerAgent(adoptPtr(new V8DebuggerAgentImpl(this)))
, m_heapProfilerAgent(adoptPtr(new V8HeapProfilerAgentImpl(this)))
@@ -62,6 +64,11 @@ V8RuntimeAgent* V8InspectorSessionImpl::runtimeAgent()
return m_runtimeAgent.get();
}
+void V8InspectorSessionImpl::setClient(V8InspectorSessionClient* client)
+{
+ m_client = client;
+}
+
void V8InspectorSessionImpl::reset()
{
m_debuggerAgent->reset();
@@ -163,4 +170,14 @@ void V8InspectorSessionImpl::reportAllContexts(V8RuntimeAgentImpl* agent)
agent->reportExecutionContextCreated(idContext.second);
}
+void V8InspectorSessionImpl::changeInstrumentationCounter(int delta)
+{
+ ASSERT(m_instrumentationCounter + delta >= 0);
+ if (!m_instrumentationCounter && m_client)
+ m_client->startInstrumenting();
+ m_instrumentationCounter += delta;
+ if (!m_instrumentationCounter && m_client)
+ m_client->stopInstrumenting();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698