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

Unified Diff: third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp

Issue 1455583002: Pass current script context to InspectorWrapper::unwrap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 1 month 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/core/inspector/v8/V8DebuggerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
index 2a7121c57f8b7d4e7f6156de1a5e7ed8d8526f1c..6abb021cb69ce6f0848fb9a2877a1b4e6990eb6f 100644
--- a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
+++ b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
@@ -109,16 +109,16 @@ static PassRefPtrWillBeRawPtr<ScriptCallStack> toScriptCallStack(JavaScriptCallF
return ScriptCallStack::create(frames);
}
-static PassRefPtr<JavaScriptCallFrame> toJavaScriptCallFrame(v8::Local<v8::Object> value)
+static PassRefPtr<JavaScriptCallFrame> toJavaScriptCallFrame(v8::Local<v8::Context> context, v8::Local<v8::Object> value)
{
if (value.IsEmpty())
return nullptr;
- return V8JavaScriptCallFrame::unwrap(value);
+ return V8JavaScriptCallFrame::unwrap(context, value);
}
-static PassRefPtrWillBeRawPtr<ScriptCallStack> toScriptCallStack(v8::Local<v8::Object> callFrames)
+static PassRefPtrWillBeRawPtr<ScriptCallStack> toScriptCallStack(v8::Local<v8::Context> context, v8::Local<v8::Object> callFrames)
{
- RefPtr<JavaScriptCallFrame> jsCallFrame = toJavaScriptCallFrame(callFrames);
+ RefPtr<JavaScriptCallFrame> jsCallFrame = toJavaScriptCallFrame(context, callFrames);
return jsCallFrame ? toScriptCallStack(jsCallFrame.get()) : nullptr;
}
@@ -1108,9 +1108,9 @@ int V8DebuggerAgentImpl::traceAsyncOperationStarting(const String& description)
RefPtr<AsyncCallChain> chain;
if (callFrames.IsEmpty()) {
if (m_currentAsyncCallChain)
- chain = AsyncCallChain::create(nullptr, m_currentAsyncCallChain.get(), m_maxAsyncCallStackDepth);
+ chain = AsyncCallChain::create(m_currentAsyncCallChain.get()->creationContext(m_isolate), nullptr, m_currentAsyncCallChain.get(), m_maxAsyncCallStackDepth);
} else {
- chain = AsyncCallChain::create(adoptRef(new AsyncCallStack(description, callFrames)), m_currentAsyncCallChain.get(), m_maxAsyncCallStackDepth);
+ chain = AsyncCallChain::create(debugger().isPaused() ? debugger().pausedContext() : m_isolate->GetCurrentContext(), adoptRef(new AsyncCallStack(description, callFrames)), m_currentAsyncCallChain.get(), m_maxAsyncCallStackDepth);
yurys 2015/11/18 18:35:00 Just m_isolate->GetCurrentContext() should work fo
jochen (gone - plz use gerrit) 2015/11/18 19:02:04 right, but for the cases where it's paused, we're
yurys 2015/11/18 19:11:24 This method should never be called when current co
}
do {
++m_lastAsyncOperationId;
@@ -1239,7 +1239,7 @@ void V8DebuggerAgentImpl::flushAsyncOperationEvents(ErrorString*)
RefPtr<AsyncStackTrace> lastAsyncStackTrace;
for (const auto& callStack : callStacks) {
v8::HandleScope scope(m_isolate);
- RefPtrWillBeRawPtr<ScriptCallStack> scriptCallStack = toScriptCallStack(callStack->callFrames(m_isolate));
+ RefPtrWillBeRawPtr<ScriptCallStack> scriptCallStack = toScriptCallStack(chain->creationContext(m_isolate), callStack->callFrames(m_isolate));
if (!scriptCallStack)
break;
if (!operation) {
@@ -1428,7 +1428,7 @@ PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> V8DebuggerAgentImpl::currentAsyncSt
RefPtrWillBeRawPtr<ScriptAsyncCallStack> result = nullptr;
for (AsyncCallStackVector::const_reverse_iterator it = callStacks.rbegin(); it != callStacks.rend(); ++it) {
v8::HandleScope scope(m_isolate);
- RefPtr<JavaScriptCallFrame> callFrame = toJavaScriptCallFrame((*it)->callFrames(m_isolate));
+ RefPtr<JavaScriptCallFrame> callFrame = toJavaScriptCallFrame(chain->creationContext(m_isolate), (*it)->callFrames(m_isolate));
if (!callFrame)
break;
result = ScriptAsyncCallStack::create((*it)->description(), toScriptCallStack(callFrame.get()), result.release());

Powered by Google App Engine
This is Rietveld 408576698