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

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: ModuleScriptLoaderTest 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..7e16d00fd4349095b0ecf936916eaaeac5ccee47 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/Modulator.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/html/DocumentNameCollection.h"
@@ -409,6 +410,17 @@ void WindowProxy::updateActivityLogger() {
: KURL()));
}
+void WindowProxy::updateModuleResolver() {
+ if (!m_frame->isLocalFrame())
+ return;
+ if (Document* document = toLocalFrame(m_frame)->document()) {
+ if (Modulator* modulator = document->ensureModulator()) {
haraken 2017/01/06 05:47:58 I'm wondering if Modulator is a per-document thing
kouhei (in TOK) 2017/01/11 01:41:57 Done.
+ m_scriptState->perContextData()->setModuleResolver(
+ modulator->scriptModuleResolver());
+ }
+ }
+}
+
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 +476,7 @@ void WindowProxy::updateDocument() {
return;
updateActivityLogger();
+ updateModuleResolver();
updateDocumentProperty();
updateSecurityOrigin(m_frame->securityContext()->getSecurityOrigin());
}

Powered by Google App Engine
This is Rietveld 408576698