Index: src/inspector/v8-stack-trace-impl.cc |
diff --git a/src/inspector/v8-stack-trace-impl.cc b/src/inspector/v8-stack-trace-impl.cc |
index 8cd33387bc172568a60d5d279158953f61df6fb3..ccf0fd9765cc4dd969684ef2a5f491fa380603a8 100644 |
--- a/src/inspector/v8-stack-trace-impl.cc |
+++ b/src/inspector/v8-stack-trace-impl.cc |
@@ -40,9 +40,8 @@ V8StackTraceImpl::Frame toFrame(v8::Local<v8::StackFrame> frame, |
int sourceColumn = frame->GetColumn() - 1; |
// TODO(clemensh): Figure out a way to do this translation only right before |
// sending the stack trace over wire. |
- if (wasmTranslation) |
- wasmTranslation->TranslateWasmScriptLocationToProtocolLocation( |
- &scriptId, &sourceLineNumber, &sourceColumn); |
+ wasmTranslation->TranslateWasmScriptLocationToProtocolLocation( |
+ &scriptId, &sourceLineNumber, &sourceColumn); |
return V8StackTraceImpl::Frame(functionName, scriptId, sourceName, |
sourceLineNumber + 1, sourceColumn + 1); |
} |
@@ -55,8 +54,7 @@ void toFramesVector(v8::Local<v8::StackTrace> stackTrace, |
int frameCount = stackTrace->GetFrameCount(); |
if (frameCount > static_cast<int>(maxStackSize)) |
frameCount = static_cast<int>(maxStackSize); |
- WasmTranslation* wasmTranslation = |
- debugger ? debugger->wasmTranslation() : nullptr; |
+ WasmTranslation* wasmTranslation = debugger->wasmTranslation(); |
for (int i = 0; i < frameCount; i++) { |
v8::Local<v8::StackFrame> stackFrame = stackTrace->GetFrame(i); |
frames.push_back(toFrame(stackFrame, wasmTranslation, contextGroupId)); |
@@ -118,7 +116,8 @@ std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::create( |
V8Debugger* debugger, int contextGroupId, |
v8::Local<v8::StackTrace> stackTrace, size_t maxStackSize, |
const String16& description) { |
- v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
+ DCHECK(debugger); |
+ v8::Isolate* isolate = debugger->inspector()->isolate(); |
v8::HandleScope scope(isolate); |
std::vector<V8StackTraceImpl::Frame> frames; |
if (!stackTrace.IsEmpty()) |
@@ -127,7 +126,7 @@ std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::create( |
int maxAsyncCallChainDepth = 1; |
V8StackTraceImpl* asyncCallChain = nullptr; |
- if (debugger && maxStackSize > 1) { |
+ if (maxStackSize > 1) { |
asyncCallChain = debugger->currentAsyncCallChain(); |
maxAsyncCallChainDepth = debugger->maxAsyncCallChainDepth(); |
} |
@@ -170,7 +169,8 @@ std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::create( |
std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::capture( |
V8Debugger* debugger, int contextGroupId, size_t maxStackSize, |
const String16& description) { |
- v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
+ DCHECK(debugger); |
+ v8::Isolate* isolate = debugger->inspector()->isolate(); |
v8::HandleScope handleScope(isolate); |
v8::Local<v8::StackTrace> stackTrace; |
if (isolate->InContext()) { |
@@ -270,7 +270,8 @@ V8StackTraceImpl::buildInspectorObjectImpl() const { |
std::unique_ptr<protocol::Runtime::StackTrace> |
V8StackTraceImpl::buildInspectorObjectForTail(V8Debugger* debugger) const { |
- v8::HandleScope handleScope(v8::Isolate::GetCurrent()); |
+ DCHECK(debugger); |
+ v8::HandleScope handleScope(debugger->inspector()->isolate()); |
// Next call collapses possible empty stack and ensures |
// maxAsyncCallChainDepth. |
std::unique_ptr<V8StackTraceImpl> fullChain = V8StackTraceImpl::create( |