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

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: lru unit tests Created 5 years, 6 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.
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 namespace media {
12
13 class Waiter {
14 public:
15 virtual ~Waiter() {}
16 virtual void Continue() = 0;
17 };
18
19 class WaiterIndex {
20 public:
21 WaiterIndex();
22 ~WaiterIndex();
23 // Register a waiter at position |pos|.
24 void WaitFor(int32_t pos, Waiter* waiter);
25 // Unregister a waiter, |pos| should be the same
26 // position as given to WaitFor().
27 void StopWaitFor(int32_t pos, Waiter* waiter);
28 // Wake up all waiters waiting at |pos|.
29 void WakeUp(int32_t pos);
30 // Delete all waiters. Makes it possible for
31 // for this class to own waiters.
32 void DeleteWaiters();
33
34 const std::map<int32_t, std::set<Waiter*> > map() const {
35 return waiters_;
36 }
37
38 private:
39 std::map<int32_t, std::set<Waiter*> > waiters_;
40 };
41
42 } // namespace media
43
44 #endif // MEDIA_BLINK_WAITER_INDEX_H
OLDNEW
« media/blink/multibuffer.cc ('K') | « media/blink/rangemap_unittests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698