Index: src/inspector/V8InspectorImpl.cpp |
diff --git a/src/inspector/V8InspectorImpl.cpp b/src/inspector/V8InspectorImpl.cpp |
index c501302140ee4ca21b3fbe42bcfc92daaeb8e2ab..f631473fad4d83a34482d6f6d00335bfeff2e4dd 100644 |
--- a/src/inspector/V8InspectorImpl.cpp |
+++ b/src/inspector/V8InspectorImpl.cpp |
@@ -37,12 +37,11 @@ |
#include "src/inspector/V8Debugger.h" |
#include "src/inspector/V8DebuggerAgentImpl.h" |
#include "src/inspector/V8InspectorSessionImpl.h" |
+#include "src/inspector/V8ProfilerAgentImpl.h" |
#include "src/inspector/V8RuntimeAgentImpl.h" |
#include "src/inspector/V8StackTraceImpl.h" |
#include "src/inspector/protocol/Protocol.h" |
-#include "include/v8-profiler.h" |
- |
namespace v8_inspector { |
std::unique_ptr<V8Inspector> V8Inspector::create(v8::Isolate* isolate, |
@@ -74,6 +73,13 @@ V8RuntimeAgentImpl* V8InspectorImpl::enabledRuntimeAgentForGroup( |
return agent && agent->enabled() ? agent : nullptr; |
} |
+V8ProfilerAgentImpl* V8InspectorImpl::enabledProfilerAgentForGroup( |
+ int contextGroupId) { |
+ V8InspectorSessionImpl* session = sessionForContextGroup(contextGroupId); |
+ V8ProfilerAgentImpl* agent = session ? session->profilerAgent() : nullptr; |
+ return agent && agent->enabled() ? agent : nullptr; |
+} |
+ |
v8::MaybeLocal<v8::Value> V8InspectorImpl::runCompiledScript( |
v8::Local<v8::Context> context, v8::Local<v8::Script> script) { |
v8::MicrotasksScope microtasksScope(m_isolate, |
@@ -271,11 +277,15 @@ void V8InspectorImpl::didExecuteScript(v8::Local<v8::Context> context) { |
} |
void V8InspectorImpl::idleStarted() { |
- m_isolate->GetCpuProfiler()->SetIdle(true); |
+ for (auto it = m_sessions.begin(); it != m_sessions.end(); ++it) { |
+ if (it->second->profilerAgent()->idleStarted()) return; |
+ } |
} |
void V8InspectorImpl::idleFinished() { |
- m_isolate->GetCpuProfiler()->SetIdle(false); |
+ for (auto it = m_sessions.begin(); it != m_sessions.end(); ++it) { |
+ if (it->second->profilerAgent()->idleFinished()) return; |
+ } |
} |
unsigned V8InspectorImpl::exceptionThrown( |