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

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

Issue 1449623002: IntersectionObserver: second cut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: sigbjornf nits Created 4 years, 11 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 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 IntersectionObserverController_h
6 #define IntersectionObserverController_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
14 namespace blink {
15
16 class IntersectionObserverController : public GarbageCollectedFinalized<Intersec tionObserverController> {
17 public:
18 IntersectionObserverController();
19 ~IntersectionObserverController();
20
21 void scheduleIntersectionObserverForDelivery(IntersectionObserver&);
22 void resumeSuspendedIntersectionObservers();
23 void deliverIntersectionObservations(Timer<IntersectionObserverController>*) ;
24 void computeTrackedIntersectionObservations();
25 void addTrackedObserver(IntersectionObserver&);
26 void removeTrackedObserversForRoot(const Element&);
27 void dispose();
28
29 DECLARE_TRACE();
30
31 private:
32 // Design doc for IntersectionObserver implementation:
33 // https://docs.google.com/a/google.com/document/d/1hLK0eyT5_BzyNS4Okjsnoq qFQDYCbKfyBinj94OnLiQ
34
35 Timer<IntersectionObserverController> m_timer;
36 // IntersectionObservers for which this is the tracking document.
37 HeapHashSet<WeakMember<IntersectionObserver>> m_trackedIntersectionObservers ;
38 // IntersectionObservers for which this is the execution context of the call back.
39 HeapHashSet<Member<IntersectionObserver>> m_activeIntersectionObservers;
haraken 2016/01/02 13:47:41 I'd rename this to m_pendingIntersectionObservers.
szager1 2016/01/02 19:18:34 Done.
40 HeapHashSet<Member<IntersectionObserver>> m_suspendedIntersectionObservers;
haraken 2016/01/02 13:47:41 As commented in another place, I'd drop this from
41 };
42
43 } // namespace blink
44
45 #endif // IntersectionObserverController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698