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

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

Issue 2322143002: Switch IntersectionObserver to postTask. (Closed)
Patch Set: use weakptr Created 4 years, 3 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 f577121caafb3b5d44bcb186072a5fd5d7dc89ef..532875c871553f7d103ad6daad7e31e4d3a47fea 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
@@ -6,10 +6,10 @@
#define IntersectionObserverController_h
#include "core/dom/ActiveDOMObject.h"
-#include "core/dom/IdleRequestCallback.h"
#include "core/dom/IntersectionObserver.h"
#include "platform/heap/Handle.h"
#include "wtf/HashSet.h"
+#include "wtf/WeakPtr.h"
// Design doc for IntersectionObserver implementation:
// https://docs.google.com/a/google.com/document/d/1hLK0eyT5_BzyNS4OkjsnoqqFQDYCbKfyBinj94OnLiQ
@@ -18,14 +18,13 @@ namespace blink {
class Document;
-class IntersectionObserverController : public IdleRequestCallback, public ActiveDOMObject {
+class IntersectionObserverController : public GarbageCollectedFinalized<IntersectionObserverController>, 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();
@@ -43,8 +42,8 @@ private:
HeapHashSet<WeakMember<IntersectionObserver>> m_trackedIntersectionObservers;
// IntersectionObservers for which this is the execution context of the callback.
HeapHashSet<Member<IntersectionObserver>> m_pendingIntersectionObservers;
+ WTF::WeakPtrFactory<IntersectionObserverController> m_weakPtrFactory;
- int m_callbackID;
bool m_callbackFiredWhileSuspended;
};

Powered by Google App Engine
This is Rietveld 408576698