Chromium Code Reviews| 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); |
| }; |