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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScript.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/InjectedScript.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
index e3e2d94269f72ef8f136a9bddcd45bacafa35d9f..b3eaf41bc6137eaad03e5f6c276d6daf2e96a939 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
@@ -423,4 +423,25 @@ void InjectedScript::wrapEvaluateResult(ErrorString* errorString, v8::MaybeLocal
}
}
+InjectedScript::ScopedGlobalObjectExtension::ScopedGlobalObjectExtension(InjectedScript* current, v8::MaybeLocal<v8::Object> extension)
+ : m_context(current->context())
+{
+ v8::Local<v8::Object> extensionObject;
+ if (!extension.ToLocal(&extensionObject))
+ return;
+
+ m_symbol = V8Debugger::scopeExtensionSymbol(current->isolate());
+ v8::Local<v8::Object> global = current->context()->Global();
+ if (global->Set(m_context, m_symbol, extensionObject).FromMaybe(false))
+ m_global = global;
+}
+
+InjectedScript::ScopedGlobalObjectExtension::~ScopedGlobalObjectExtension()
+{
+ v8::Local<v8::Object> global;
+ if (!m_global.ToLocal(&global))
+ return;
+ global->Delete(m_context, m_symbol);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698