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

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

Issue 2272773002: Use intersection observer to control frame throttling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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..609658043949a82b62938c08f20b34fa2bc68e77 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
@@ -16,6 +16,7 @@
namespace blink {
+class CancellableTaskFactory;
class Document;
class IntersectionObserverController : public IdleRequestCallback, public ActiveDOMObject {
@@ -39,10 +40,17 @@ private:
explicit IntersectionObserverController(Document*);
private:
+ void scheduleIdleNotification(IntersectionObserver&);
+ void scheduleLowLatencyNotification(IntersectionObserver&);
+ void deliverLowLatencyNotifications();
+
// 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;
+ HeapHashSet<Member<IntersectionObserver>> m_pendingLowLatencyIntersectionObservers;
+
+ std::unique_ptr<CancellableTaskFactory> m_lowLatencyNotificationTask;
haraken 2016/09/12 00:46:32 IIUC, we've decided to use WeakPtrFactory to post
int m_callbackID;
bool m_callbackFiredWhileSuspended;

Powered by Google App Engine
This is Rietveld 408576698