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

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

Issue 1449623002: IntersectionObserver: second cut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add RuntimeEnabled flags to all idl's, fix test expectations. Created 4 years, 11 months 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 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);

Powered by Google App Engine
This is Rietveld 408576698