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

Unified Diff: third_party/WebKit/Source/core/dom/IntersectionObserverController.h

Issue 1552213002: Implement suspend/resume for IntersectionObserver notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer
Patch Set: Create IntersectionObserverController on demand 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/IntersectionObserverController.h
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserverController.h b/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
index fe4bb867083354e71b07927c6b454e5d54830c2c..efc3d6571a6a53af3cc026440e1c7bc8c4013bb2 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
@@ -11,13 +11,18 @@
#include "platform/heap/Handle.h"
#include "wtf/HashSet.h"
+// Design doc for IntersectionObserver implementation:
+// https://docs.google.com/a/google.com/document/d/1hLK0eyT5_BzyNS4OkjsnoqqFQDYCbKfyBinj94OnLiQ
+
namespace blink {
-class IntersectionObserverController : public GarbageCollectedFinalized<IntersectionObserverController> {
+class IntersectionObserverController : public GarbageCollectedFinalized<IntersectionObserverController>, public ActiveDOMObject {
public:
- IntersectionObserverController();
+ static IntersectionObserverController* create(Document*);
~IntersectionObserverController();
+ void resume() override;
+
void scheduleIntersectionObserverForDelivery(IntersectionObserver&);
void deliverIntersectionObservations(Timer<IntersectionObserverController>*);
void computeTrackedIntersectionObservations();
@@ -27,14 +32,16 @@ public:
DECLARE_TRACE();
private:
- // Design doc for IntersectionObserver implementation:
- // https://docs.google.com/a/google.com/document/d/1hLK0eyT5_BzyNS4OkjsnoqqFQDYCbKfyBinj94OnLiQ
+ explicit IntersectionObserverController(Document*);
+private:
Timer<IntersectionObserverController> m_timer;
// IntersectionObservers for which this is the tracking document.
HeapHashSet<WeakMember<IntersectionObserver>> m_trackedIntersectionObservers;
// IntersectionObservers for which this is the execution context of the callback.
HeapHashSet<Member<IntersectionObserver>> m_pendingIntersectionObservers;
+
+ bool m_timerFiredWhileSuspended;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698