Chromium Code Reviews| Index: third_party/WebKit/Source/core/observer/ResizeObserverController.h |
| diff --git a/third_party/WebKit/Source/core/observer/ResizeObserverController.h b/third_party/WebKit/Source/core/observer/ResizeObserverController.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..50e8925708e4826c7fd314fdce130bd856dd0f0f |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/observer/ResizeObserverController.h |
| @@ -0,0 +1,40 @@ |
| +// 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 ResizeObserverController_h |
| +#define ResizeObserverController_h |
| + |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class ResizeObserver; |
| + |
| +// ResizeObserverController keeps track of all ResizeObservers |
| +// in a single Document. |
| +class ResizeObserverController : public GarbageCollected<ResizeObserverController> { |
| + |
| +public: |
| + |
| + static const size_t kRenderLoopLimit = 16; |
|
eae
2016/07/13 23:39:47
A comment explaining the limit would be helpful.
atotic1
2016/07/15 01:43:17
This limit will go away in the final checkin.
|
| + |
| + ResizeObserverController(); |
| + |
| + void addObserver(ResizeObserver&); |
| + bool gatherObservations(); |
| + void deliverObservations(); |
| + void clearObservations(); |
| + |
| + DECLARE_TRACE(); |
| + |
| +private: |
| + |
| + using ObserverSet = HeapHashSet<WeakMember<ResizeObserver>>; |
| + // Active observers |
| + ObserverSet m_observers; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif |