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

Side by Side Diff: media/audio/cross_process_notification.cc

Issue 9605015: Add a SharedMemSynchronizer class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed class and file names according to Ami's wishes. Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698