Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp |
| index 69aae26cc7439d356c027922de5f987807095437..0b23c3981de4b396fe0ca22649de41aed4cdb020 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp |
| @@ -46,6 +46,7 @@ |
| #include "bindings/core/v8/V8PagePopupControllerBinding.h" |
| #include "bindings/core/v8/V8PrivateProperty.h" |
| #include "bindings/core/v8/V8Window.h" |
| +#include "core/dom/ModulatorImpl.h" |
| #include "core/frame/LocalFrame.h" |
| #include "core/frame/csp/ContentSecurityPolicy.h" |
| #include "core/html/DocumentNameCollection.h" |
| @@ -409,6 +410,19 @@ void WindowProxy::updateActivityLogger() { |
| : KURL())); |
| } |
| +void WindowProxy::updateModulator() { |
| + DCHECK(m_world->isMainWorld()); |
| + |
| + if (!RuntimeEnabledFeatures::moduleScriptsEnabled()) |
| + return; |
| + if (!m_frame->isLocalFrame()) |
| + return; |
| + if (Document* document = toLocalFrame(m_frame)->document()) { |
| + Modulator* modulator = ModulatorImpl::create(m_scriptState, *document); |
|
haraken
2017/01/11 02:31:28
How heavy would it be to create Modulator for all
kouhei (in TOK)
2017/01/17 05:26:13
Done.
|
| + m_scriptState->perContextData()->setModulator(modulator); |
| + } |
| +} |
| + |
| void WindowProxy::setSecurityToken(SecurityOrigin* origin) { |
| // If two tokens are equal, then the SecurityOrigins canAccess each other. |
| // If two tokens are not equal, then we have to call canAccess. |
| @@ -464,6 +478,7 @@ void WindowProxy::updateDocument() { |
| return; |
| updateActivityLogger(); |
| + updateModulator(); |
| updateDocumentProperty(); |
| updateSecurityOrigin(m_frame->securityContext()->getSecurityOrigin()); |
| } |