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

Unified Diff: content/browser/renderer_host/media/audio_input_renderer_host.cc

Issue 2941773002: Added initial muted state to stream creation callback, to avoid races. (Closed)
Patch Set: Added mute information to DoCompleteCreation log message. Created 3 years, 6 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/browser/renderer_host/media/audio_input_renderer_host.cc
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc
index 439da3335e74f399c356052cc517b1a980f4c5bf..dc96e627591cecd46c44f2ee9a2e3cfaa8a3c41f 100644
--- a/content/browser/renderer_host/media/audio_input_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc
@@ -135,12 +135,12 @@ void AudioInputRendererHost::OnDestruct() const {
BrowserThread::DeleteOnIOThread::Destruct(this);
}
-void AudioInputRendererHost::OnCreated(
- media::AudioInputController* controller) {
+void AudioInputRendererHost::OnCreated(media::AudioInputController* controller,
+ bool initially_muted) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::BindOnce(&AudioInputRendererHost::DoCompleteCreation, this,
- base::RetainedRef(controller)));
+ base::RetainedRef(controller), initially_muted));
}
void AudioInputRendererHost::OnError(media::AudioInputController* controller,
@@ -173,7 +173,8 @@ void AudioInputRendererHost::set_renderer_pid(int32_t renderer_pid) {
}
void AudioInputRendererHost::DoCompleteCreation(
- media::AudioInputController* controller) {
+ media::AudioInputController* controller,
+ bool initially_muted) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
AudioEntry* entry = LookupByController(controller);
@@ -205,13 +206,15 @@ void AudioInputRendererHost::DoCompleteCreation(
}
LogMessage(entry->stream_id,
- "DoCompleteCreation: IPC channel and stream are now open",
+ base::StringPrintf("DoCompleteCreation: IPC channel and stream "
+ "are now open (initially %s",
+ initially_muted ? "muted" : "not muted"),
true);
Send(new AudioInputMsg_NotifyStreamCreated(
entry->stream_id, foreign_memory_handle, socket_transit_descriptor,
writer->shared_memory()->requested_size(),
- writer->shared_memory_segment_count()));
+ writer->shared_memory_segment_count(), initially_muted));
// Free the foreign socket on here since it isn't needed anymore in this
// process.

Powered by Google App Engine
This is Rietveld 408576698