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

Unified Diff: Source/core/html/StableState.h

Issue 153813002: Support "await a stable state" and "provide a stable state" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: assert more Created 6 years, 10 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: Source/core/html/StableState.h
diff --git a/Source/core/html/StableState.h b/Source/core/html/StableState.h
new file mode 100644
index 0000000000000000000000000000000000000000..764cdd5c3ab6d9ec0acf892b0a1cf9ad17caa884
--- /dev/null
+++ b/Source/core/html/StableState.h
@@ -0,0 +1,36 @@
+// Copyright 2014 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 StableState_h
+#define StableState_h
+
+namespace WebCore {
+
+class StableState {
+public:
+ class Awaiter {
+ public:
+ virtual ~Awaiter();
+ virtual void didAwaitStableState() = 0;
acolwell GONE FROM CHROMIUM 2014/02/10 22:36:05 nit: didAwaitStableState seems like an awkward nam
philipj_slow 2014/02/11 17:25:21 I rather like my name, actually, it blends well wi
acolwell GONE FROM CHROMIUM 2014/02/18 18:47:42 You're right. I retract my objection. I'm fine wit
+ };
+
+ // Await a stable state. Adding the same awaiter again has no effect. The
+ // only way to stop awaiting a stable state is to delete the awaiter.
+ //
+ // http://whatwg.org/html#await-a-stable-state
+ static void await(Awaiter&);
+
+ // Provide a stable state. Each awaiter will be notified once and then
+ // forgotten. Calling await() inside the callback is not allowed.
+ //
+ // http://whatwg.org/html#provide-a-stable-state
+ static void provide();
+
+private:
+ explicit StableState();
+};
+
+}
+
+#endif // StableState_h

Powered by Google App Engine
This is Rietveld 408576698