OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2336 | 2336 |
2337 bool RenderProcessHostImpl::StartWebRTCEventLog( | 2337 bool RenderProcessHostImpl::StartWebRTCEventLog( |
2338 const base::FilePath& file_path) { | 2338 const base::FilePath& file_path) { |
2339 return webrtc_eventlog_host_.StartWebRTCEventLog(file_path); | 2339 return webrtc_eventlog_host_.StartWebRTCEventLog(file_path); |
2340 } | 2340 } |
2341 | 2341 |
2342 bool RenderProcessHostImpl::StopWebRTCEventLog() { | 2342 bool RenderProcessHostImpl::StopWebRTCEventLog() { |
2343 return webrtc_eventlog_host_.StopWebRTCEventLog(); | 2343 return webrtc_eventlog_host_.StopWebRTCEventLog(); |
2344 } | 2344 } |
2345 | 2345 |
2346 void RenderProcessHostImpl::SetEchoCanceller3(bool enable) { | |
2347 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
2348 | |
2349 // Piggybacking on AEC dumps. | |
2350 // TODO(hlundin) Consider changing name for aec_dump_consumers_. | |
Henrik Grunell
2017/04/10 08:13:28
I think this should be done. I'm OK with a follow-
hlundin-chromium
2017/04/10 10:10:16
Done.
| |
2351 for (std::vector<int>::iterator it = aec_dump_consumers_.begin(); | |
2352 it != aec_dump_consumers_.end(); ++it) { | |
2353 SetEchoCanceller3ForId(enable, *it); | |
Henrik Grunell
2017/04/10 08:13:28
Just do
Send(new AudioProcessingMsg_EnableAec3(id
hlundin-chromium
2017/04/10 10:10:16
Done.
| |
2354 } | |
2355 } | |
2356 | |
2346 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( | 2357 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( |
2347 base::Callback<void(const std::string&)> callback) { | 2358 base::Callback<void(const std::string&)> callback) { |
2348 #if BUILDFLAG(ENABLE_WEBRTC) | 2359 #if BUILDFLAG(ENABLE_WEBRTC) |
2349 BrowserMainLoop::GetInstance()->media_stream_manager()-> | 2360 BrowserMainLoop::GetInstance()->media_stream_manager()-> |
2350 RegisterNativeLogCallback(GetID(), callback); | 2361 RegisterNativeLogCallback(GetID(), callback); |
2351 #endif | 2362 #endif |
2352 } | 2363 } |
2353 | 2364 |
2354 void RenderProcessHostImpl::ClearWebRtcLogMessageCallback() { | 2365 void RenderProcessHostImpl::ClearWebRtcLogMessageCallback() { |
2355 #if BUILDFLAG(ENABLE_WEBRTC) | 2366 #if BUILDFLAG(ENABLE_WEBRTC) |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2988 } | 2999 } |
2989 | 3000 |
2990 void RenderProcessHostImpl::RegisterAecDumpConsumerOnUIThread(int id) { | 3001 void RenderProcessHostImpl::RegisterAecDumpConsumerOnUIThread(int id) { |
2991 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 3002 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2992 aec_dump_consumers_.push_back(id); | 3003 aec_dump_consumers_.push_back(id); |
2993 | 3004 |
2994 if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) { | 3005 if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) { |
2995 base::FilePath file_with_extensions = GetAecDumpFilePathWithExtensions( | 3006 base::FilePath file_with_extensions = GetAecDumpFilePathWithExtensions( |
2996 WebRTCInternals::GetInstance()->GetAudioDebugRecordingsFilePath()); | 3007 WebRTCInternals::GetInstance()->GetAudioDebugRecordingsFilePath()); |
2997 EnableAecDumpForId(file_with_extensions, id); | 3008 EnableAecDumpForId(file_with_extensions, id); |
2998 } | 3009 } |
Henrik Grunell
2017/04/10 08:13:28
Here, you need to set experiments for a new consum
hlundin-chromium
2017/04/10 10:10:16
Done.
Added a class member to remember the state.
| |
2999 } | 3010 } |
3000 | 3011 |
3001 void RenderProcessHostImpl::UnregisterAecDumpConsumerOnUIThread(int id) { | 3012 void RenderProcessHostImpl::UnregisterAecDumpConsumerOnUIThread(int id) { |
3002 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 3013 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
3003 for (std::vector<int>::iterator it = aec_dump_consumers_.begin(); | 3014 for (std::vector<int>::iterator it = aec_dump_consumers_.begin(); |
3004 it != aec_dump_consumers_.end(); ++it) { | 3015 it != aec_dump_consumers_.end(); ++it) { |
3005 if (*it == id) { | 3016 if (*it == id) { |
3006 aec_dump_consumers_.erase(it); | 3017 aec_dump_consumers_.erase(it); |
3007 break; | 3018 break; |
3008 } | 3019 } |
(...skipping 20 matching lines...) Expand all Loading... | |
3029 | 3040 |
3030 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() { | 3041 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() { |
3031 Send(new AecDumpMsg_DisableAecDump()); | 3042 Send(new AecDumpMsg_DisableAecDump()); |
3032 } | 3043 } |
3033 | 3044 |
3034 base::FilePath RenderProcessHostImpl::GetAecDumpFilePathWithExtensions( | 3045 base::FilePath RenderProcessHostImpl::GetAecDumpFilePathWithExtensions( |
3035 const base::FilePath& file) { | 3046 const base::FilePath& file) { |
3036 return file.AddExtension(IntToStringType(base::GetProcId(GetHandle()))) | 3047 return file.AddExtension(IntToStringType(base::GetProcId(GetHandle()))) |
3037 .AddExtension(kAecDumpFileNameAddition); | 3048 .AddExtension(kAecDumpFileNameAddition); |
3038 } | 3049 } |
3050 | |
3051 void RenderProcessHostImpl::SetEchoCanceller3ForId(bool enable, int id) { | |
3052 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
3053 Send(new AudioProcessingMsg_EnableAec3(id, enable)); | |
3054 } | |
3039 #endif // BUILDFLAG(ENABLE_WEBRTC) | 3055 #endif // BUILDFLAG(ENABLE_WEBRTC) |
3040 | 3056 |
3041 void RenderProcessHostImpl::GetAudioOutputControllers( | 3057 void RenderProcessHostImpl::GetAudioOutputControllers( |
3042 const GetAudioOutputControllersCallback& callback) const { | 3058 const GetAudioOutputControllersCallback& callback) const { |
3043 audio_renderer_host()->GetOutputControllers(callback); | 3059 audio_renderer_host()->GetOutputControllers(callback); |
3044 } | 3060 } |
3045 | 3061 |
3046 void RenderProcessHostImpl::RecomputeAndUpdateWebKitPreferences() { | 3062 void RenderProcessHostImpl::RecomputeAndUpdateWebKitPreferences() { |
3047 // We are updating all widgets including swapped out ones. | 3063 // We are updating all widgets including swapped out ones. |
3048 for (auto* widget : widgets_) { | 3064 for (auto* widget : widgets_) { |
(...skipping 11 matching lines...) Expand all Loading... | |
3060 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3076 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3061 | 3077 |
3062 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3078 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
3063 // Capture the error message in a crash key value. | 3079 // Capture the error message in a crash key value. |
3064 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3080 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
3065 bad_message::ReceivedBadMessage(render_process_id, | 3081 bad_message::ReceivedBadMessage(render_process_id, |
3066 bad_message::RPH_MOJO_PROCESS_ERROR); | 3082 bad_message::RPH_MOJO_PROCESS_ERROR); |
3067 } | 3083 } |
3068 | 3084 |
3069 } // namespace content | 3085 } // namespace content |
OLD | NEW |