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

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: WIP: ModuleLoaderClient && crafts to make it work even if notifyFinished adds another ModuleLoaderC… 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 b40ae4ad1496b3bb428b657b41cc41debda2c5c1..a64067574b01d56eafeeac40af646a438dc87708 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"
@@ -6453,6 +6454,17 @@ PropertyRegistry* Document::propertyRegistry() {
return m_propertyRegistry;
}
+ModuleMap* Document::ensureModuleMap() {
+ if (!RuntimeEnabledFeatures::moduleScriptsEnabled())
+ return nullptr;
+
+ if (!m_moduleMap) {
+ m_moduleMap = ModuleMap::create(frame(), fetcher());
+ }
+
+ return m_moduleMap;
+}
+
void Document::incrementPasswordCount() {
++m_passwordCount;
if (isSecureContext() || m_passwordCount != 1) {
@@ -6534,6 +6546,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