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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: ScriptModule interaction refactored to ScriptController Created 4 years 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/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index f4f788fd4ec931f6d4d44f15d5c6bf7759737bdb..06ddf60a6494021a065fee3f1d1e3454674f7f00 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -89,6 +89,7 @@
#include "core/dom/IntersectionObserverController.h"
#include "core/dom/LayoutTreeBuilderTraversal.h"
#include "core/dom/LiveNodeList.h"
+#include "core/dom/ModuleMap.h"
#include "core/dom/MutationObserver.h"
#include "core/dom/NodeChildRemovalTracker.h"
#include "core/dom/NodeComputedStyle.h"
@@ -6437,6 +6438,17 @@ PropertyRegistry* Document::propertyRegistry() {
return m_propertyRegistry;
}
+ModuleMap* Document::ensureModuleMap() {
+ if (!RuntimeEnabledFeatures::moduleScriptsEnabled())
+ return nullptr;
+
+ if (!m_moduleMap && frame()) {
+ m_moduleMap = ModuleMap::create(&frame()->script(), fetcher());
+ }
+
+ return m_moduleMap;
+}
+
void Document::incrementPasswordCount() {
++m_passwordCount;
if (isSecureContext() || m_passwordCount != 1) {
@@ -6517,6 +6529,7 @@ DEFINE_TRACE(Document) {
visitor->trace(m_resizeObserverController);
visitor->trace(m_propertyRegistry);
visitor->trace(m_styleReattachDataMap);
+ visitor->trace(m_moduleMap);
Supplementable<Document>::trace(visitor);
TreeScope::trace(visitor);
ContainerNode::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698