Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
|
liberato (no reviews please)
2015/10/09 17:36:10
2015
hubbe
2015/10/13 23:08:17
Gone.
| |
| 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 MEDIA_BLINK_WAITER_INDEX_H_ | |
| 6 #define MEDIA_BLINK_WAITER_INDEX_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <set> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 | |
| 13 namespace media { | |
| 14 | |
| 15 class Waiter { | |
| 16 public: | |
| 17 Waiter() {} | |
| 18 virtual ~Waiter() {} | |
| 19 virtual void Continue() = 0; | |
| 20 private: | |
| 21 DISALLOW_COPY_AND_ASSIGN(Waiter); | |
| 22 }; | |
| 23 | |
| 24 class WaiterIndex { | |
|
liberato (no reviews please)
2015/10/09 17:36:10
why is WaiterIndex included in this CL?
hubbe
2015/10/13 23:08:17
Gone.
| |
| 25 public: | |
| 26 WaiterIndex(); | |
| 27 ~WaiterIndex(); | |
| 28 // Register a waiter at position |pos|. | |
| 29 void WaitFor(int32_t pos, Waiter* waiter); | |
| 30 // Unregister a waiter, |pos| should be the same | |
| 31 // position as given to WaitFor(). | |
| 32 void StopWaitFor(int32_t pos, Waiter* waiter); | |
| 33 // Wake up all waiters waiting at |pos|. | |
| 34 void WakeUp(int32_t pos); | |
| 35 | |
| 36 const std::map<int32_t, std::set<Waiter*> >& map() const { | |
| 37 return waiters_; | |
| 38 } | |
| 39 | |
| 40 private: | |
| 41 std::map<int32_t, std::set<Waiter*> > waiters_; | |
| 42 }; | |
| 43 | |
| 44 } // namespace media | |
| 45 | |
| 46 #endif // MEDIA_BLINK_WAITER_INDEX_H | |
| OLD | NEW |