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

Unified Diff: content/renderer/media/webrtc_audio_device_unittest.cc

Issue 8799011: remove the race related to output_delay_ms_ in ADM and races in the unittests. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_audio_device_unittest.cc
===================================================================
--- content/renderer/media/webrtc_audio_device_unittest.cc (revision 111890)
+++ content/renderer/media/webrtc_audio_device_unittest.cc (working copy)
@@ -107,6 +107,7 @@
const int length,
const int sampling_freq,
const bool is_stereo) {
+ base::AutoLock auto_lock(lock_);
channel_id_ = channel;
type_ = type;
packet_size_ = length;
@@ -118,11 +119,21 @@
}
}
- int channel_id() const { return channel_id_; }
- int type() const { return type_; }
- int packet_size() const { return packet_size_; }
- int sample_rate() const { return sample_rate_; }
- int channels() const { return channels_; }
+ int channel_id() const {
+ base::AutoLock auto_lock(lock_);
+ return channel_id_; }
scherkus (not reviewing) 2011/12/08 23:49:42 drive by nit: drop } to next line here + below
no longer working on chromium 2011/12/09 09:48:19 Done.
+ int type() const {
+ base::AutoLock auto_lock(lock_);
+ return type_; }
+ int packet_size() const {
+ base::AutoLock auto_lock(lock_);
+ return packet_size_; }
+ int sample_rate() const {
+ base::AutoLock auto_lock(lock_);
+ return sample_rate_; }
+ int channels() const {
+ base::AutoLock auto_lock(lock_);
+ return channels_; }
private:
base::WaitableEvent* event_;
@@ -131,6 +142,7 @@
int packet_size_;
int sample_rate_;
int channels_;
+ mutable base::Lock lock_;
DISALLOW_COPY_AND_ASSIGN(WebRTCMediaProcessImpl);
};

Powered by Google App Engine
This is Rietveld 408576698