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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp

Issue 2400563002: Adds Mojo IDL. (Closed)
Patch Set: injects mojo object Created 3 years, 11 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/bindings/core/v8/LocalWindowProxy.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp
index b8e036990940bd6c1bcb5e18aee2afcea3b8871c..6e44b872d977d4297620dfe8437e139861c6addd 100644
--- a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp
@@ -49,6 +49,7 @@
#include "core/inspector/MainThreadDebugger.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
+#include "core/mojo/Mojo.h"
#include "core/origin_trials/OriginTrialContext.h"
#include "platform/Histogram.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -120,14 +121,21 @@ void LocalWindowProxy::initialize() {
origin);
frame()->loader().client()->didCreateScriptContext(context,
m_world->worldId());
- // If conditional features for window have been queued before the V8 context
- // was ready, then inject them into the context now
+
if (m_world->isMainWorld()) {
+ if (RuntimeEnabledFeatures::mojoJSEnabled()) {
+ LOG(INFO) << "Installing mojo bindings";
+ v8::Local<v8::Object> global = context->Global();
+ v8::Local<v8::Value> mojo = ToV8(Mojo::create(), global, isolate());
+ global->Set(context, v8AtomicString(isolate(), "mojo"), mojo).ToChecked();
+ }
+
+ // If conditional features for window have been queued before the V8 context
+ // was ready, then inject them into the context now
installPendingConditionalFeaturesOnWindow(m_scriptState.get());
- }
- if (m_world->isMainWorld())
frame()->loader().dispatchDidClearWindowObjectInMainWorld();
+ }
}
void LocalWindowProxy::createContext() {

Powered by Google App Engine
This is Rietveld 408576698