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 c69e212363ca0f5e1fe74a96c436c013208b4706..4237ea7772ed94881c260de74fd65dc0bb770b4f 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -35,6 +35,7 @@ |
#include "bindings/core/v8/ExceptionStatePlaceholder.h" |
#include "bindings/core/v8/HTMLScriptElementOrSVGScriptElement.h" |
#include "bindings/core/v8/Microtask.h" |
+#include "bindings/core/v8/ModuleController.h" |
#include "bindings/core/v8/ScriptController.h" |
#include "bindings/core/v8/SourceLocation.h" |
#include "bindings/core/v8/StringOrDictionary.h" |
@@ -89,6 +90,7 @@ |
#include "core/dom/IntersectionObserverController.h" |
#include "core/dom/LayoutTreeBuilderTraversal.h" |
#include "core/dom/LiveNodeList.h" |
+#include "core/dom/ModulatorImpl.h" |
#include "core/dom/MutationObserver.h" |
#include "core/dom/NodeChildRemovalTracker.h" |
#include "core/dom/NodeComputedStyle.h" |
@@ -6445,6 +6447,19 @@ PropertyRegistry* Document::propertyRegistry() { |
return m_propertyRegistry; |
} |
+Modulator* Document::ensureModulator() { |
+ if (!RuntimeEnabledFeatures::moduleScriptsEnabled()) |
+ return nullptr; |
+ |
+ if (!m_modulator && frame()) { |
+ m_modulator = ModulatorImpl::create( |
+ this, ModuleController::create(ScriptState::forMainWorld(frame())), |
+ fetcher()); |
+ } |
+ |
+ return m_modulator; |
+} |
+ |
const PropertyRegistry* Document::propertyRegistry() const { |
return const_cast<Document*>(this)->propertyRegistry(); |
} |
@@ -6529,6 +6544,7 @@ DEFINE_TRACE(Document) { |
visitor->trace(m_resizeObserverController); |
visitor->trace(m_propertyRegistry); |
visitor->trace(m_styleReattachDataMap); |
+ visitor->trace(m_modulator); |
Supplementable<Document>::trace(visitor); |
TreeScope::trace(visitor); |
ContainerNode::trace(visitor); |