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

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

Issue 9605015: Add a SharedMemSynchronizer class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments from Ami 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/shared_mem_synchronizer.h"
6
7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h"
9
10 SharedMemSynchronizer::SharedMemSynchronizer() {}
11
12 SharedMemSynchronizer::WaitForMultiple::WaitForMultiple(
13 const SynchronizerVector* synchronizers)
14 : synchronizers_(synchronizers), last_(synchronizers_->size() - 1) {
Ami GONE FROM CHROMIUM 2012/03/13 20:08:02 Why init last_ (an unsigned type) to the result of
tommi (sloooow) - chröme 2012/03/14 13:32:43 Done.
15 DCHECK_GT(synchronizers_->size(), 0U);
Ami GONE FROM CHROMIUM 2012/03/13 20:08:02 clearer as DCHECK(!synchronizers_->empty());
tommi (sloooow) - chröme 2012/03/14 13:32:43 Done.
16 }
17
18 int SharedMemSynchronizer::WaitForMultiple::Wait() {
19 int ret = WaitMultiple(*synchronizers_, last_);
20 last_ = static_cast<size_t>(ret);
21 return ret;
22 }
23
24 void SharedMemSynchronizer::WaitForMultiple::Reset(
25 const SynchronizerVector* synchronizers) {
26 synchronizers_ = synchronizers;
27 DCHECK_GT(synchronizers_->size(), 0U);
Ami GONE FROM CHROMIUM 2012/03/13 20:08:02 ditto
Ami GONE FROM CHROMIUM 2012/03/13 20:08:02 reset next_start_offset_ (nee last_)?
tommi (sloooow) - chröme 2012/03/14 13:32:43 Done.
tommi (sloooow) - chröme 2012/03/14 13:32:43 Done.
28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698