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

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

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: address haraken/yhirano comments 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/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());
}

Powered by Google App Engine
This is Rietveld 408576698