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

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: rebase 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
« no previous file with comments | « content/renderer/media/webrtc_audio_device_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « content/renderer/media/webrtc_audio_device_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698