| 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() {
|
|
|