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 ec1828a24daa069536b54b7d3d653779ad704e78..df832f7db176bb54b4f18b99212d522ebdf6757c 100644 |
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
@@ -405,14 +405,8 @@ bool InjectedScript::Scope::initialize() |
bool InjectedScript::Scope::installCommandLineAPI() |
{ |
- DCHECK(m_injectedScript && !m_context.IsEmpty() && m_global.IsEmpty()); |
- m_extensionPrivate = V8Debugger::scopeExtensionPrivate(m_debugger->isolate()); |
- v8::Local<v8::Object> global = m_context->Global(); |
- if (!global->SetPrivate(m_context, m_extensionPrivate, m_injectedScript->commandLineAPI()).FromMaybe(false)) { |
- *m_errorString = "Internal error"; |
- return false; |
- } |
- m_global = global; |
+ DCHECK(m_injectedScript && !m_context.IsEmpty() && m_installedAPI.IsEmpty()); |
+ m_installedAPI = V8Console::installCommandLineAPI(m_context, m_context->Global(), m_injectedScript->commandLineAPI()); |
return true; |
} |
@@ -443,11 +437,11 @@ void InjectedScript::Scope::pretendUserGesture() |
void InjectedScript::Scope::cleanup() |
{ |
- v8::Local<v8::Object> global; |
- if (m_global.ToLocal(&global)) { |
+ v8::Local<v8::Object> installedAPI; |
+ if (m_installedAPI.ToLocal(&installedAPI)) { |
DCHECK(!m_context.IsEmpty()); |
- global->DeletePrivate(m_context, m_extensionPrivate); |
- m_global = v8::MaybeLocal<v8::Object>(); |
+ V8Console::clearCommandLineAPI(m_context, m_context->Global(), installedAPI); |
+ m_installedAPI = v8::MaybeLocal<v8::Object>(); |
} |
if (!m_context.IsEmpty()) { |
m_context->Exit(); |