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

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

Issue 1992493002: [DevTools] Pass bindRemoteObject function to Custom Formatter directly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 3d9ee343044587fc2ecd1e0f04c1e2534cfdb040..ce17d2ba52e0768a30739b5fef62e23c10eb457d 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
@@ -413,34 +413,13 @@ bool InjectedScript::Scope::initialize()
bool InjectedScript::Scope::installCommandLineAPI()
{
- ASSERT(m_injectedScript && !m_context.IsEmpty());
+ DCHECK(m_injectedScript && !m_context.IsEmpty() && m_global.IsEmpty());
v8::Local<v8::Object> extensionObject;
if (!m_injectedScript->commandLineAPI(m_errorString).ToLocal(&extensionObject))
return false;
- return installGlobalObjectExtension(extensionObject);
-}
-
-bool InjectedScript::Scope::installRemoteObjectAPI(const String16& objectGroupName)
-{
- ASSERT(m_injectedScript && !m_context.IsEmpty());
- V8FunctionCall function(m_debugger, m_context, m_injectedScript->v8Value(), "remoteObjectAPI");
- function.appendArgument(objectGroupName);
- bool hadException = false;
- v8::Local<v8::Value> extension = function.call(hadException, false);
- if (hadException || extension.IsEmpty() || !extension->IsObject()) {
- *m_errorString = "Internal error";
- return false;
- }
- v8::Local<v8::Object> extensionObject = extension.As<v8::Object>();
- return installGlobalObjectExtension(extensionObject);
-}
-
-bool InjectedScript::Scope::installGlobalObjectExtension(v8::Local<v8::Object> extension)
-{
- ASSERT(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, extension).FromMaybe(false)) {
+ if (!global->SetPrivate(m_context, m_extensionPrivate, extensionObject).FromMaybe(false)) {
*m_errorString = "Internal error";
return false;
}

Powered by Google App Engine
This is Rietveld 408576698