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

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

Issue 1836653002: [DevTools] Wrap call frame with its injected script instead top injected script (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compile-debugger-script
Patch Set: Created 4 years, 9 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/V8DebuggerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
index e4d02edffe51d09c1aa0d0f3a33d975635ef3313..5453629a3c0edc11c7051e3dd54a1b3c635d238d 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
@@ -1005,7 +1005,7 @@ void V8DebuggerAgentImpl::evaluateOnCallFrame(ErrorString* errorString,
if (includeCommandLineAPI.fromMaybe(false) && commandLineAPI.IsEmpty())
return;
- InjectedScriptManager::ScopedGlobalObjectExtension scopeExtension(injectedScript, m_injectedScriptManager, commandLineAPI);
+ InjectedScript::ScopedGlobalObjectExtension scopeExtension(injectedScript, commandLineAPI);
v8::TryCatch tryCatch(injectedScript->isolate());
@@ -1353,15 +1353,15 @@ PassOwnPtr<Array<CallFrame>> V8DebuggerAgentImpl::currentCallFrames(ErrorString*
{
if (m_pausedContext.IsEmpty() || !m_currentCallStack)
return Array<CallFrame>::create();
- InjectedScript* injectedScript = m_injectedScriptManager->injectedScriptFor(m_pausedContext.Get(m_isolate));
- if (!injectedScript) {
+ InjectedScript* topFrameInjectedScript = m_injectedScriptManager->injectedScriptFor(m_pausedContext.Get(m_isolate));
+ if (!topFrameInjectedScript) {
// Context has been reported as removed while on pause.
return Array<CallFrame>::create();
}
- v8::Isolate* isolate = injectedScript->isolate();
+ v8::Isolate* isolate = topFrameInjectedScript->isolate();
v8::HandleScope handles(isolate);
- v8::Local<v8::Context> context = injectedScript->context();
+ v8::Local<v8::Context> context = topFrameInjectedScript->context();
v8::Context::Scope contextScope(context);
JavaScriptCallFrame* currentCallFrame = m_currentCallStack.get();
@@ -1373,6 +1373,13 @@ PassOwnPtr<Array<CallFrame>> V8DebuggerAgentImpl::currentCallFrames(ErrorString*
if (hasInternalError(errorString, details.IsEmpty()))
return Array<CallFrame>::create();
+ int contextId = currentCallFrame->contextId();
+ InjectedScript* injectedScript = contextId ? m_injectedScriptManager->findInjectedScript(errorString, contextId) : nullptr;
+ if (!injectedScript) {
+ *errorString = "";
dgozman 2016/03/28 16:14:30 Pass different error string instead.
kozy 2016/03/28 17:59:19 Done.
+ injectedScript = topFrameInjectedScript;
+ }
+
String16 callFrameId = RemoteCallFrameId::serialize(injectedScript->contextId(), callFrameIndex);
if (hasInternalError(errorString, !details->Set(context, toV8StringInternalized(isolate, "callFrameId"), toV8String(isolate, callFrameId)).FromMaybe(false)))
return Array<CallFrame>::create();

Powered by Google App Engine
This is Rietveld 408576698