| 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
|
|
|