Index: media/audio/shared_mem_synchronizer.cc |
diff --git a/media/audio/shared_mem_synchronizer.cc b/media/audio/shared_mem_synchronizer.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a3487f69c50011cfd061ea6652d58a1ba8bd2200 |
--- /dev/null |
+++ b/media/audio/shared_mem_synchronizer.cc |
@@ -0,0 +1,28 @@ |
+// 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/shared_mem_synchronizer.h" |
+ |
+#include "base/logging.h" |
+#include "base/memory/scoped_ptr.h" |
+ |
+SharedMemSynchronizer::SharedMemSynchronizer() {} |
+ |
+SharedMemSynchronizer::WaitForMultiple::WaitForMultiple( |
+ const SynchronizerVector* synchronizers) |
+ : 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.
|
+ 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.
|
+} |
+ |
+int SharedMemSynchronizer::WaitForMultiple::Wait() { |
+ int ret = WaitMultiple(*synchronizers_, last_); |
+ last_ = static_cast<size_t>(ret); |
+ return ret; |
+} |
+ |
+void SharedMemSynchronizer::WaitForMultiple::Reset( |
+ const SynchronizerVector* synchronizers) { |
+ synchronizers_ = synchronizers; |
+ 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.
|
+} |