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

Unified Diff: third_party/WebKit/Source/core/observer/ResizeObserverController.h

Issue 2005593002: Initial ResizeObserver implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix global-interface-listing test Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698