OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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 #include "media/audio/cross_process_notification.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "base/memory/scoped_ptr.h" | |
9 | |
10 CrossProcessNotification::CrossProcessNotification() {} | |
11 | |
12 CrossProcessNotification::WaitForMultiple::WaitForMultiple( | |
13 const Notifications* notifications) | |
Ami GONE FROM CHROMIUM
2012/03/14 16:40:51
FWIW the initializer-list & ctor body can both be
tommi (sloooow) - chröme
2012/03/14 21:20:38
Done.
| |
14 : notifications_(notifications), wait_offset_(0) { | |
15 DCHECK(!notifications_->empty()); | |
16 } | |
17 | |
18 int CrossProcessNotification::WaitForMultiple::Wait() { | |
19 DCHECK(CalledOnValidThread()); | |
20 int ret = WaitMultiple(*notifications_, wait_offset_); | |
21 wait_offset_ = (static_cast<size_t>(ret) + 1) % notifications_->size(); | |
Ami GONE FROM CHROMIUM
2012/03/14 16:40:51
Is the static_cast<size_t>() really necessary?
(I
tommi (sloooow) - chröme
2012/03/14 21:20:38
it's not necessary. removed.
| |
22 return ret; | |
23 } | |
24 | |
25 void CrossProcessNotification::WaitForMultiple::Reset( | |
26 const Notifications* notifications) { | |
27 DCHECK(CalledOnValidThread()); | |
28 wait_offset_ = 0; | |
29 notifications_ = notifications; | |
30 DCHECK(!notifications_->empty()); | |
31 } | |
OLD | NEW |