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 |