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 |