Index: content/renderer/media/webrtc_audio_device_unittest.cc |
=================================================================== |
--- content/renderer/media/webrtc_audio_device_unittest.cc (revision 113802) |
+++ 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,12 +119,31 @@ |
} |
} |
- 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_; |
+ } |
+ 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_; |
int channel_id_; |
@@ -131,6 +151,7 @@ |
int packet_size_; |
int sample_rate_; |
int channels_; |
+ mutable base::Lock lock_; |
DISALLOW_COPY_AND_ASSIGN(WebRTCMediaProcessImpl); |
}; |