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

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: violate the spec 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..fc279e30bc0b15a52213b5ae3c579c553df79881
--- /dev/null
+++ b/Source/core/html/StableState.h
@@ -0,0 +1,38 @@
+// 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();
+ // Invoked by provide(). An awaiter may delete itself in the callback,
+ // but must not delete any other awaiter or call await() or provide().
+ virtual void didAwaitStableState() = 0;
+ };
+
+ // 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.
+ //
+ // 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