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.
5 #include "media/audio/cross_process_notification.h"
7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h"
10 CrossProcessNotification::CrossProcessNotification() {}
12 CrossProcessNotification::WaitForMultiple::WaitForMultiple(
13 const Notifications
* notifications
) {
17 int CrossProcessNotification::WaitForMultiple::Wait() {
18 DCHECK(CalledOnValidThread());
19 int ret
= WaitMultiple(*notifications_
, wait_offset_
);
20 wait_offset_
= (ret
+ 1) % notifications_
->size();
24 void CrossProcessNotification::WaitForMultiple::Reset(
25 const Notifications
* notifications
) {
26 DCHECK(CalledOnValidThread());
28 notifications_
= notifications
;
29 DCHECK(!notifications_
->empty());