Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/ElementIntersectionObserverData.h |
| diff --git a/third_party/WebKit/Source/core/dom/ElementIntersectionObserverData.h b/third_party/WebKit/Source/core/dom/ElementIntersectionObserverData.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..34ca694da40a9786949ad284909701fcc642adef |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/dom/ElementIntersectionObserverData.h |
| @@ -0,0 +1,45 @@ |
| +// 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 ElementIntersectionObserverData_h |
| +#define ElementIntersectionObserverData_h |
| + |
| +#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.
|
| +#include "core/dom/IntersectionObserver.h" |
|
esprehn
2015/12/17 01:40:28
ditto
szager1
2015/12/17 20:27:25
Done.
|
| + |
| +namespace blink { |
| + |
| +class ElementIntersectionObserverData : public GarbageCollectedFinalized<ElementIntersectionObserverData> { |
| +public: |
| + DECLARE_TRACE(); |
| + 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.
|
| + |
| + bool hasIntersectionObserver() const; |
| + bool hasIntersectionObservation() const; |
| + bool hasObservationFor(IntersectionObserver&) const; |
| + void addObservation(IntersectionObservation&); |
| + void removeObservation(IntersectionObserver&); |
| + void activateValidIntersectionObservers(Element&); |
| + void deactivateAllIntersectionObservers(Element&); |
| + |
| +#if !ENABLE(OILPAN) |
| + void dispose(); |
| +#endif |
| + |
| + WeakPtr<Element> createWeakPtr(Element*); |
| + |
| +private: |
| + // IntersectionObservers for which the Element owning this data is root. |
| + HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers; |
| + // IntersectionObservations for which the Element owning this data is target. |
| + HeapHashMap<Member<IntersectionObserver>, Member<IntersectionObservation>> m_intersectionObservations; |
| + |
| +#if !ENABLE(OILPAN) |
| + OwnPtrWillBeMember<WeakPtrFactory<Element>> m_weakPointerFactory; |
| +#endif |
| +}; |
| + |
| +} // namespace blink { |
| + |
| +#endif // ElementIntersectionObserverData_h |