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

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: Added dispose() methods for expicit cleanup 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 ElementIntersectionObserverData_h
6 #define ElementIntersectionObserverData_h
7
8 #include "core/dom/IntersectionObservation.h"
esprehn 2015/12/17 01:40:28 you can forward declare IntersectionObservation if
szager1 2015/12/17 20:27:25 Yep, it works, done.
9 #include "core/dom/IntersectionObserver.h"
esprehn 2015/12/17 01:40:28 ditto
szager1 2015/12/17 20:27:25 Done.
10
11 namespace blink {
12
13 class ElementIntersectionObserverData : public GarbageCollectedFinalized<Element IntersectionObserverData> {
14 public:
15 DECLARE_TRACE();
16 ElementIntersectionObserverData() { }
esprehn 2015/12/17 01:40:28 can we put both the constructor and the destructor
szager1 2015/12/17 20:27:25 Done.
17
18 bool hasIntersectionObserver() const;
19 bool hasIntersectionObservation() const;
20 bool hasObservationFor(IntersectionObserver&) const;
21 void addObservation(IntersectionObservation&);
22 void removeObservation(IntersectionObserver&);
23 void activateValidIntersectionObservers(Element&);
24 void deactivateAllIntersectionObservers(Element&);
25
26 #if !ENABLE(OILPAN)
27 void dispose();
28 #endif
29
30 WeakPtr<Element> createWeakPtr(Element*);
31
32 private:
33 // IntersectionObservers for which the Element owning this data is root.
34 HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers;
35 // IntersectionObservations for which the Element owning this data is target .
36 HeapHashMap<Member<IntersectionObserver>, Member<IntersectionObservation>> m _intersectionObservations;
37
38 #if !ENABLE(OILPAN)
39 OwnPtrWillBeMember<WeakPtrFactory<Element>> m_weakPointerFactory;
40 #endif
41 };
42
43 } // namespace blink {
44
45 #endif // ElementIntersectionObserverData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698