Index: src/inspector/V8StackTraceImpl.cpp |
diff --git a/src/inspector/V8StackTraceImpl.cpp b/src/inspector/V8StackTraceImpl.cpp |
index 25a0e7caf7892fd68b21cc0a37fa66cd5eee186f..972f2d28e894dfdea59a57a3ffc5aaee043e19d1 100644 |
--- a/src/inspector/V8StackTraceImpl.cpp |
+++ b/src/inspector/V8StackTraceImpl.cpp |
@@ -6,6 +6,8 @@ |
#include "src/inspector/StringUtil.h" |
#include "src/inspector/V8Debugger.h" |
+#include "src/inspector/V8InspectorImpl.h" |
+#include "src/inspector/V8ProfilerAgentImpl.h" |
#include "src/inspector/protocol/Protocol.h" |
#include "include/v8-debug.h" |
@@ -158,7 +160,12 @@ std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::capture( |
v8::HandleScope handleScope(isolate); |
v8::Local<v8::StackTrace> stackTrace; |
if (isolate->InContext()) { |
- isolate->GetCpuProfiler()->CollectSample(); |
+ if (debugger) { |
+ V8InspectorImpl* inspector = debugger->inspector(); |
+ V8ProfilerAgentImpl* profilerAgent = |
+ inspector->enabledProfilerAgentForGroup(contextGroupId); |
+ if (profilerAgent) profilerAgent->collectSample(); |
+ } |
stackTrace = v8::StackTrace::CurrentStackTrace(isolate, maxStackSize, |
stackTraceOptions); |
} |