Index: media/blink/waiter_index.h |
diff --git a/media/blink/waiter_index.h b/media/blink/waiter_index.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0f79b80e84442c7be2fdc19fc28f274bb054493a |
--- /dev/null |
+++ b/media/blink/waiter_index.h |
@@ -0,0 +1,46 @@ |
+// 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.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MEDIA_BLINK_WAITER_INDEX_H_ |
+#define MEDIA_BLINK_WAITER_INDEX_H_ |
+ |
+#include <map> |
+#include <set> |
+ |
+#include "base/macros.h" |
+ |
+namespace media { |
+ |
+class Waiter { |
+public: |
+ Waiter() {} |
+ virtual ~Waiter() {} |
+ virtual void Continue() = 0; |
+private: |
+ DISALLOW_COPY_AND_ASSIGN(Waiter); |
+}; |
+ |
+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.
|
+public: |
+ WaiterIndex(); |
+ ~WaiterIndex(); |
+ // Register a waiter at position |pos|. |
+ void WaitFor(int32_t pos, Waiter* waiter); |
+ // Unregister a waiter, |pos| should be the same |
+ // position as given to WaitFor(). |
+ void StopWaitFor(int32_t pos, Waiter* waiter); |
+ // Wake up all waiters waiting at |pos|. |
+ void WakeUp(int32_t pos); |
+ |
+ const std::map<int32_t, std::set<Waiter*> >& map() const { |
+ return waiters_; |
+ } |
+ |
+ private: |
+ std::map<int32_t, std::set<Waiter*> > waiters_; |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_BLINK_WAITER_INDEX_H |