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

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

Issue 1449623002: IntersectionObserver: second cut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Implemented root margin Created 5 years 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/IntersectionObserverRegistry.h
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserverRegistry.h b/third_party/WebKit/Source/core/dom/IntersectionObserverRegistry.h
new file mode 100644
index 0000000000000000000000000000000000000000..5918e83da4a06a53f75218790889a16f282897db
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserverRegistry.h
@@ -0,0 +1,44 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IntersectionObserverRegistry_h
+#define IntersectionObserverRegistry_h
+
+#include "core/dom/Element.h"
+#include "core/dom/IntersectionObserver.h"
+#include "platform/Timer.h"
+#include "platform/heap/Handle.h"
+#include "wtf/HashSet.h"
+#include "wtf/RefCounted.h"
+
+namespace blink {
+
+class Document;
+template<typename T> class Timer;
+
+class IntersectionObserverRegistry : public GarbageCollectedFinalized<IntersectionObserverRegistry> {
esprehn 2015/12/12 00:14:16 controller or something
szager1 2015/12/16 19:15:37 Renamed to IntersectionObserverController.
+public:
+ IntersectionObserverRegistry(Timer<Document>&);
+
+ void scheduleIntersectionObserverForDelivery(IntersectionObserver&);
+ void resumeSuspendedIntersectionObservers();
+ void deliverIntersectionObservations();
+ void computeTrackedIntersectionObservations();
+ void addTrackedObserver(IntersectionObserver&);
+ void removeTrackedObserversForRoot(Element*);
esprehn 2015/12/12 00:14:16 reference
szager1 2015/12/16 19:15:37 Done.
+
+ DECLARE_TRACE();
+
+private:
+ Timer<Document>& m_timer;
esprehn 2015/12/12 00:14:16 this should live here, not in document
szager1 2015/12/16 19:15:37 Done.
+ // IntersectionObservers for which this is the tracking document.
+ Member<IntersectionObserver::WeakHashSet> m_trackedIntersectionObservers;
esprehn 2015/12/12 00:14:16 just put them as members? they don't need to be in
szager1 2015/12/16 19:15:37 Done.
+ // IntersectionObservers for which this is the execution context of the callback.
+ Member<IntersectionObserver::HashSet> m_activeIntersectionObservers;
+ Member<IntersectionObserver::HashSet> m_suspendedIntersectionObservers;
esprehn 2015/12/12 00:14:16 ditto for these, also just write the types
szager1 2015/12/16 19:15:37 Done.
+};
+
+} // namespace blink
+
+#endif // IntersectionObservationRegistry_h

Powered by Google App Engine
This is Rietveld 408576698