Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: media/blink/waiter_index.h

Issue 1165903002: Multi reader/writer cache/buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698