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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2801853005: Create a private API for controlling WebRTC's AEC3 (Closed)
Patch Set: After grunell's second round of comments Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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
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): Change name for aec_dump_consumers_;
2351 // http://crbug.com/709919.
2352 for (std::vector<int>::iterator it = aec_dump_consumers_.begin();
2353 it != aec_dump_consumers_.end(); ++it) {
2354 Send(new AudioProcessingMsg_EnableAec3(*it, enable));
2355 }
2356 override_aec3_ = base::Optional<bool>(enable);
2357 }
2358
2346 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( 2359 void RenderProcessHostImpl::SetWebRtcLogMessageCallback(
2347 base::Callback<void(const std::string&)> callback) { 2360 base::Callback<void(const std::string&)> callback) {
2348 #if BUILDFLAG(ENABLE_WEBRTC) 2361 #if BUILDFLAG(ENABLE_WEBRTC)
2349 BrowserMainLoop::GetInstance()->media_stream_manager()-> 2362 BrowserMainLoop::GetInstance()->media_stream_manager()->
2350 RegisterNativeLogCallback(GetID(), callback); 2363 RegisterNativeLogCallback(GetID(), callback);
2351 #endif 2364 #endif
2352 } 2365 }
2353 2366
2354 void RenderProcessHostImpl::ClearWebRtcLogMessageCallback() { 2367 void RenderProcessHostImpl::ClearWebRtcLogMessageCallback() {
2355 #if BUILDFLAG(ENABLE_WEBRTC) 2368 #if BUILDFLAG(ENABLE_WEBRTC)
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 3002
2990 void RenderProcessHostImpl::RegisterAecDumpConsumerOnUIThread(int id) { 3003 void RenderProcessHostImpl::RegisterAecDumpConsumerOnUIThread(int id) {
2991 DCHECK_CURRENTLY_ON(BrowserThread::UI); 3004 DCHECK_CURRENTLY_ON(BrowserThread::UI);
2992 aec_dump_consumers_.push_back(id); 3005 aec_dump_consumers_.push_back(id);
2993 3006
2994 if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) { 3007 if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) {
2995 base::FilePath file_with_extensions = GetAecDumpFilePathWithExtensions( 3008 base::FilePath file_with_extensions = GetAecDumpFilePathWithExtensions(
2996 WebRTCInternals::GetInstance()->GetAudioDebugRecordingsFilePath()); 3009 WebRTCInternals::GetInstance()->GetAudioDebugRecordingsFilePath());
2997 EnableAecDumpForId(file_with_extensions, id); 3010 EnableAecDumpForId(file_with_extensions, id);
2998 } 3011 }
3012 if (override_aec3_) {
3013 Send(new AudioProcessingMsg_EnableAec3(id, *override_aec3_));
3014 }
2999 } 3015 }
3000 3016
3001 void RenderProcessHostImpl::UnregisterAecDumpConsumerOnUIThread(int id) { 3017 void RenderProcessHostImpl::UnregisterAecDumpConsumerOnUIThread(int id) {
3002 DCHECK_CURRENTLY_ON(BrowserThread::UI); 3018 DCHECK_CURRENTLY_ON(BrowserThread::UI);
3003 for (std::vector<int>::iterator it = aec_dump_consumers_.begin(); 3019 for (std::vector<int>::iterator it = aec_dump_consumers_.begin();
3004 it != aec_dump_consumers_.end(); ++it) { 3020 it != aec_dump_consumers_.end(); ++it) {
3005 if (*it == id) { 3021 if (*it == id) {
3006 aec_dump_consumers_.erase(it); 3022 aec_dump_consumers_.erase(it);
3007 break; 3023 break;
3008 } 3024 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698