| Index: media/audio/cross_process_notification.cc
|
| diff --git a/media/audio/cross_process_notification.cc b/media/audio/cross_process_notification.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1806f777da31cea4a9bf737549382f7a89cc8426
|
| --- /dev/null
|
| +++ b/media/audio/cross_process_notification.cc
|
| @@ -0,0 +1,30 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "media/audio/cross_process_notification.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +
|
| +CrossProcessNotification::CrossProcessNotification() {}
|
| +
|
| +CrossProcessNotification::WaitForMultiple::WaitForMultiple(
|
| + const Notifications* notifications) {
|
| + Reset(notifications);
|
| +}
|
| +
|
| +int CrossProcessNotification::WaitForMultiple::Wait() {
|
| + DCHECK(CalledOnValidThread());
|
| + int ret = WaitMultiple(*notifications_, wait_offset_);
|
| + wait_offset_ = (ret + 1) % notifications_->size();
|
| + return ret;
|
| +}
|
| +
|
| +void CrossProcessNotification::WaitForMultiple::Reset(
|
| + const Notifications* notifications) {
|
| + DCHECK(CalledOnValidThread());
|
| + wait_offset_ = 0;
|
| + notifications_ = notifications;
|
| + DCHECK(!notifications_->empty());
|
| +}
|
|
|