Mailbox support for texture layers.
[chromium-blink-merge.git] / media / audio / cross_process_notification.cc
blob1806f777da31cea4a9bf737549382f7a89cc8426
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) {
14 Reset(notifications);
17 int CrossProcessNotification::WaitForMultiple::Wait() {
18 DCHECK(CalledOnValidThread());
19 int ret = WaitMultiple(*notifications_, wait_offset_);
20 wait_offset_ = (ret + 1) % notifications_->size();
21 return ret;
24 void CrossProcessNotification::WaitForMultiple::Reset(
25 const Notifications* notifications) {
26 DCHECK(CalledOnValidThread());
27 wait_offset_ = 0;
28 notifications_ = notifications;
29 DCHECK(!notifications_->empty());