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..007fe5de8bdae51ac7679b1b55bc6e8c3563ffac |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/dom/ElementIntersectionObserverData.h |
| @@ -0,0 +1,49 @@ |
| +// 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 "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class Element; |
| +class IntersectionObservation; |
| +class IntersectionObserver; |
| + |
| +class ElementIntersectionObserverData : public GarbageCollectedFinalized<ElementIntersectionObserverData> { |
| +public: |
| + DECLARE_TRACE(); |
| + ElementIntersectionObserverData(); |
| + ~ElementIntersectionObserverData(); |
| + |
| + 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 |
| + |
| + WeakPtrWillBeRawPtr<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; |
|
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
|
| + |
| +#if !ENABLE(OILPAN) |
| + OwnPtr<WeakPtrFactory<Element>> m_weakPointerFactory; |
| +#endif |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // ElementIntersectionObserverData_h |