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

Side by Side Diff: third_party/WebKit/Source/core/dom/IntersectionObservationRegistry.h

Issue 1449623002: IntersectionObserver: second cut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Use existing Document::m_weakFactory. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IntersectionObservationRegistry_h
6 #define IntersectionObservationRegistry_h
7
8 #include "core/dom/Element.h"
9 #include "core/dom/IntersectionObserver.h"
10 #include "platform/Timer.h"
11 #include "platform/heap/Handle.h"
12 #include "wtf/HashSet.h"
13 #include "wtf/RefCounted.h"
14
15 namespace blink {
16
17 class Document;
18 template<typename T> class Timer;
19
20 typedef HeapHashSet<Member<IntersectionObserver>> IntersectionObserverHashSet;
21
22 class IntersectionObservationRegistry : public GarbageCollectedFinalized<Interse ctionObservationRegistry> {
23 public:
24 IntersectionObservationRegistry(Timer<Document>&);
25
26 void activateIntersectionObserver(IntersectionObserver&);
27 void resumeSuspendedIntersectionObservers();
28 void deliverIntersectionObservations();
29 void clearIntersectionObservations();
30 void computeIntersectionObservations();
31 void addObservation(IntersectionObservation&);
32 void removeObservation(IntersectionObservation&);
33
34 DECLARE_TRACE();
35
36 private:
37 Timer<Document>& m_timer;
38 Member<IntersectionObserverHashSet> m_activeIntersectionObservers;
39 Member<IntersectionObserverHashSet> m_suspendedIntersectionObservers;
40 Member<IntersectionObservation::HashSet> m_intersectionObservations;
41 };
42
43 } // namespace blink
44
45 #endif // IntersectionObservationRegistry_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698