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

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

Issue 1806133002: IntersectionObserver: use an idle callback to send notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 4 years, 8 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 3757835f894d2b8484ae014bee3e71f5aa0ac244..998685d06520d863ca42155e11249bffa4c26667 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
@@ -6,8 +6,8 @@
#define IntersectionObserverController_h
#include "core/dom/Element.h"
+#include "core/dom/IdleRequestCallback.h"
#include "core/dom/IntersectionObserver.h"
-#include "platform/Timer.h"
#include "platform/heap/Handle.h"
#include "wtf/HashSet.h"
@@ -16,16 +16,17 @@
namespace blink {
-class IntersectionObserverController : public GarbageCollectedFinalized<IntersectionObserverController>, public ActiveDOMObject {
+class IntersectionObserverController : public IdleRequestCallback, public ActiveDOMObject {
USING_GARBAGE_COLLECTED_MIXIN(IntersectionObserverController);
public:
static IntersectionObserverController* create(Document*);
~IntersectionObserverController();
void resume() override;
+ void handleEvent(IdleDeadline*) override;
void scheduleIntersectionObserverForDelivery(IntersectionObserver&);
- void deliverIntersectionObservations(Timer<IntersectionObserverController>*);
+ void deliverIntersectionObservations();
void computeTrackedIntersectionObservations();
void addTrackedObserver(IntersectionObserver&);
void removeTrackedObserversForRoot(const Node&);
@@ -36,13 +37,13 @@ private:
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;
+ int m_callbackID;
+ bool m_callbackFiredWhileSuspended;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698