Chromium Code Reviews| Index: content/browser/webrtc/webrtc_internals.cc |
| diff --git a/content/browser/webrtc/webrtc_internals.cc b/content/browser/webrtc/webrtc_internals.cc |
| index 51163e96e3439eaee4b11387502201b880dde4a6..19b6fd1f7d57e37351117fb989defa898c1770bd 100644 |
| --- a/content/browser/webrtc/webrtc_internals.cc |
| +++ b/content/browser/webrtc/webrtc_internals.cc |
| @@ -19,6 +19,7 @@ |
| #include "content/public/browser/web_contents.h" |
| #include "device/power_save_blocker/power_save_blocker.h" |
| #include "ipc/ipc_platform_file.h" |
| +#include "media/audio/audio_manager.h" |
| #include "media/media_features.h" |
| #if defined(OS_WIN) |
| @@ -323,13 +324,19 @@ void WebRTCInternals::DisableAudioDebugRecordings() { |
| // Tear down the dialog since the user has unchecked the audio debug |
| // recordings box. |
| - select_file_dialog_ = NULL; |
| + select_file_dialog_ = nullptr; |
| for (RenderProcessHost::iterator i( |
| content::RenderProcessHost::AllHostsIterator()); |
| !i.IsAtEnd(); i.Advance()) { |
| i.GetCurrentValue()->DisableAudioDebugRecordings(); |
| } |
| + |
| + // AudioManager is deleted on the audio thread, and the AudioManager outlives |
| + // this object, so it's safe to post unretained. |
| + media::AudioManager::Get()->GetTaskRunner()->PostTask( |
|
DaleCurtis
2017/01/19 17:44:34
Ditto on reuse.
Henrik Grunell
2017/01/20 10:38:55
Done.
|
| + FROM_HERE, base::Bind(&media::AudioManager::DisableOutputDebugRecording, |
| + base::Unretained(media::AudioManager::Get()))); |
| #endif |
| } |
| @@ -491,12 +498,20 @@ void WebRTCInternals::EnableAudioDebugRecordingsOnAllRenderProcessHosts() { |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| audio_debug_recordings_ = true; |
| + |
| for (RenderProcessHost::iterator i( |
| content::RenderProcessHost::AllHostsIterator()); |
| !i.IsAtEnd(); i.Advance()) { |
| i.GetCurrentValue()->EnableAudioDebugRecordings( |
| audio_debug_recordings_file_path_); |
| } |
| + |
| + // AudioManager is deleted on the audio thread, and the AudioManager outlives |
| + // this object, so it's safe to post unretained. |
| + media::AudioManager::Get()->GetTaskRunner()->PostTask( |
|
DaleCurtis
2017/01/19 17:44:34
Ditto.
Henrik Grunell
2017/01/20 10:38:55
Done.
|
| + FROM_HERE, base::Bind(&media::AudioManager::EnableOutputDebugRecording, |
| + base::Unretained(media::AudioManager::Get()), |
| + audio_debug_recordings_file_path_)); |
| } |
| void WebRTCInternals::EnableEventLogRecordingsOnAllRenderProcessHosts() { |