Chromium Code Reviews| Index: third_party/WebKit/Source/core/observer/ResizeObservation.h |
| diff --git a/third_party/WebKit/Source/core/observer/ResizeObservation.h b/third_party/WebKit/Source/core/observer/ResizeObservation.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..68d45d5120bc851e99d5cb2d96cf8231af967834 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/observer/ResizeObservation.h |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2016 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 ResizeObservation_h |
| +#define ResizeObservation_h |
| + |
| +#include "core/observer/ResizeObserverEntry.h" |
| +#include "platform/geometry/LayoutSize.h" |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class Element; |
| +class ResizeObserver; |
| + |
| +// ResizeObservation represents an element that is being observed. |
| +class ResizeObservation : public GarbageCollected<ResizeObservation> { |
|
esprehn
2016/07/21 17:52:28
final
atotic1
2016/07/21 19:15:00
Done.
|
| +public: |
| + ResizeObservation(Element* target, ResizeObserver*); |
| + |
| + Element* target() const { return m_target; } |
| + |
| + DECLARE_TRACE(); |
| + |
| +private: |
| + WeakMember<Element> m_target; |
| + // m_observer only purpose is to maintain a strong reference |
| + // to the ResizeObserver, to prevent it from being garbage-collected. |
|
esprehn
2016/07/21 17:52:28
is this still true once you go to a push model?
atotic1
2016/07/21 19:15:00
Good catch, no it is not. Done.
|
| + Member<ResizeObserver> m_observer; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // ResizeObservation_h |