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

Side by Side Diff: third_party/WebKit/Source/core/dom/ElementIntersectionObserverData.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 ElementIntersectionObserverData_h
6 #define ElementIntersectionObserverData_h
7
8 #include "platform/heap/Handle.h"
9
10 namespace blink {
11
12 class Element;
13 class IntersectionObservation;
14 class IntersectionObserver;
15
16 class ElementIntersectionObserverData : public GarbageCollectedFinalized<Element IntersectionObserverData> {
17 public:
18 DECLARE_TRACE();
19 ElementIntersectionObserverData();
20 ~ElementIntersectionObserverData();
21
22 bool hasIntersectionObserver() const;
23 bool hasIntersectionObservation() const;
24 bool hasObservationFor(IntersectionObserver&) const;
25 void addObservation(IntersectionObservation&);
26 void removeObservation(IntersectionObserver&);
27 void activateValidIntersectionObservers(Element&);
28 void deactivateAllIntersectionObservers(Element&);
29
30 #if !ENABLE(OILPAN)
31 void dispose();
32 #endif
33
34 WeakPtrWillBeRawPtr<Element> createWeakPtr(Element*);
35
36 private:
37 // IntersectionObservers for which the Element owning this data is root.
38 HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers;
39 // IntersectionObservations for which the Element owning this data is target .
40 HeapHashMap<Member<IntersectionObserver>, Member<IntersectionObservation>> m _intersectionObservations;
haraken 2016/01/02 13:47:40 I think this hash map is key for getting rid of ch
szager1 2016/01/02 19:18:34 I don't understand this comment. How does this ad
haraken 2016/01/03 16:34:20 Yeah, I was confused. You're right. This may not
szager1 2016/01/04 03:53:04 IntersectionObserver::observe() calls into m_inter
41
42 #if !ENABLE(OILPAN)
43 OwnPtr<WeakPtrFactory<Element>> m_weakPointerFactory;
44 #endif
45 };
46
47 } // namespace blink
48
49 #endif // ElementIntersectionObserverData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698