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

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: snapshot Dec19 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 4ffc72475f1c82ab79acda020a9e116141c2ab00..d32e8603ba3abd9d42bdc53a5dc1dbc58be633de 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"
@@ -6449,6 +6450,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) {
@@ -6529,6 +6541,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