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

Unified Diff: content/renderer/pepper/pepper_media_stream_audio_track_host.h

Issue 417753002: Fix a race condition in MediaStreamAudioTrackHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload Created 6 years, 5 months 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/pepper/pepper_media_stream_audio_track_host.h
diff --git a/content/renderer/pepper/pepper_media_stream_audio_track_host.h b/content/renderer/pepper/pepper_media_stream_audio_track_host.h
index 348103c9928c55faa4c7beca1e0259b2347e07a4..e57ed44c2d39ffa976a100282e3d60966217e379 100644
--- a/content/renderer/pepper/pepper_media_stream_audio_track_host.h
+++ b/content/renderer/pepper/pepper_media_stream_audio_track_host.h
@@ -54,7 +54,8 @@ class PepperMediaStreamAudioTrackHost : public PepperMediaStreamTrackHostBase {
void InitBuffers();
// Send enqueue buffer message on the main thread.
- void SendEnqueueBufferMessageOnMainThread(int32_t index);
+ void SendEnqueueBufferMessageOnMainThread(int32_t index,
+ int32_t buffers_init_count);
// MediaStreamAudioSink overrides:
// These two functions should be called on the audio thread.
@@ -92,12 +93,16 @@ class PepperMediaStreamAudioTrackHost : public PepperMediaStreamTrackHostBase {
// Access only on the audio thread.
uint32_t buffer_data_size_;
- // A lock to protect the index queue |buffers_|.
+ // A lock to protect the index queue |buffers_|, |init_buffers_count_| and
+ // buffers in |host_->buffer_manager()|.
base::Lock lock_;
// A queue for free buffer indices.
std::deque<int32_t> buffers_;
+ // Count of |InitBuffers()| calls.
+ int32_t init_buffers_count_;
Anand Mistry (off Chromium) 2014/07/25 00:42:54 To me, after reading the code, I think it would be
Peng 2014/07/25 15:25:31 Done.
+
scoped_refptr<base::MessageLoopProxy> main_message_loop_proxy_;
base::ThreadChecker audio_thread_checker_;

Powered by Google App Engine
This is Rietveld 408576698