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 6d357f3e0001db462506e231f1702cf2cf6cf8f2..b0a7d6840732c2405363ac2f822c1367ee20aece 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -75,6 +75,7 @@ |
#include "core/dom/ExceptionCode.h" |
#include "core/dom/ExecutionContextTask.h" |
#include "core/dom/FrameRequestCallback.h" |
+#include "core/dom/IntersectionObserverController.h" |
#include "core/dom/LayoutTreeBuilderTraversal.h" |
#include "core/dom/MainThreadTaskRunner.h" |
#include "core/dom/Microtask.h" |
@@ -4583,11 +4584,7 @@ WeakPtrWillBeRawPtr<Document> Document::contextDocument() |
if (m_contextDocument) |
return m_contextDocument; |
if (m_frame) { |
-#if ENABLE(OILPAN) |
- return this; |
-#else |
- return m_weakFactory.createWeakPtr(); |
-#endif |
+ return createWeakPtr(); |
} |
return nullptr; |
} |
@@ -5063,6 +5060,22 @@ void Document::parseDNSPrefetchControlHeader(const String& dnsPrefetchControl) |
m_haveExplicitlyDisabledDNSPrefetch = true; |
} |
+WeakPtrWillBeRawPtr<Document> Document::createWeakPtr() |
+{ |
+#if ENABLE(OILPAN) |
+ return this; |
+#else |
+ return m_weakFactory.createWeakPtr(); |
+#endif |
+} |
+ |
+IntersectionObserverController& Document::ensureIntersectionObserverController() |
+{ |
+ if (!m_intersectionObserverController) |
+ m_intersectionObserverController = new IntersectionObserverController(); |
+ return *m_intersectionObserverController; |
+} |
+ |
void Document::reportBlockedScriptExecutionToInspector(const String& directiveText) |
{ |
InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText); |
@@ -5866,6 +5879,7 @@ DEFINE_TRACE(Document) |
visitor->trace(m_compositorPendingAnimations); |
visitor->trace(m_contextDocument); |
visitor->trace(m_canvasFontCache); |
+ visitor->trace(m_intersectionObserverController); |
WillBeHeapSupplementable<Document>::trace(visitor); |
#endif |
TreeScope::trace(visitor); |