OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef StableState_h |
| 6 #define StableState_h |
| 7 |
| 8 namespace WebCore { |
| 9 |
| 10 class StableState { |
| 11 public: |
| 12 class Awaiter { |
| 13 public: |
| 14 virtual ~Awaiter(); |
| 15 // Invoked by provide(). An awaiter may delete itself in the callback, |
| 16 // but must not delete any other awaiter or call await() or provide(). |
| 17 virtual void didAwaitStableState() = 0; |
| 18 }; |
| 19 |
| 20 // Await a stable state. Adding the same awaiter again has no effect. The |
| 21 // only way to stop awaiting a stable state is to delete the awaiter. |
| 22 // |
| 23 // http://whatwg.org/html#await-a-stable-state |
| 24 static void await(Awaiter&); |
| 25 |
| 26 // Provide a stable state. Each awaiter will be notified once and then |
| 27 // forgotten. |
| 28 // |
| 29 // http://whatwg.org/html#provide-a-stable-state |
| 30 static void provide(); |
| 31 |
| 32 private: |
| 33 explicit StableState(); |
| 34 }; |
| 35 |
| 36 } |
| 37 |
| 38 #endif // StableState_h |
OLD | NEW |