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

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: Remember the override in RPHI 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_; http://crbug.com/709919.
Henrik Grunell 2017/04/10 12:33:47 Super-nit: add : after )
hlundin-chromium 2017/04/10 13:03:17 Done, but it breaks my line-length optimization...
Henrik Grunell 2017/04/10 17:08:40 Sorry... :o
2351 for (std::vector<int>::iterator it = aec_dump_consumers_.begin();
2352 it != aec_dump_consumers_.end(); ++it) {
2353 Send(new AudioProcessingMsg_EnableAec3(*it, enable));
2354 }
2355 override_aec3_ = base::Optional<bool>(enable);
2356 }
2357
2346 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( 2358 void RenderProcessHostImpl::SetWebRtcLogMessageCallback(
2347 base::Callback<void(const std::string&)> callback) { 2359 base::Callback<void(const std::string&)> callback) {
2348 #if BUILDFLAG(ENABLE_WEBRTC) 2360 #if BUILDFLAG(ENABLE_WEBRTC)
2349 BrowserMainLoop::GetInstance()->media_stream_manager()-> 2361 BrowserMainLoop::GetInstance()->media_stream_manager()->
2350 RegisterNativeLogCallback(GetID(), callback); 2362 RegisterNativeLogCallback(GetID(), callback);
2351 #endif 2363 #endif
2352 } 2364 }
2353 2365
2354 void RenderProcessHostImpl::ClearWebRtcLogMessageCallback() { 2366 void RenderProcessHostImpl::ClearWebRtcLogMessageCallback() {
2355 #if BUILDFLAG(ENABLE_WEBRTC) 2367 #if BUILDFLAG(ENABLE_WEBRTC)
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 3001
2990 void RenderProcessHostImpl::RegisterAecDumpConsumerOnUIThread(int id) { 3002 void RenderProcessHostImpl::RegisterAecDumpConsumerOnUIThread(int id) {
2991 DCHECK_CURRENTLY_ON(BrowserThread::UI); 3003 DCHECK_CURRENTLY_ON(BrowserThread::UI);
2992 aec_dump_consumers_.push_back(id); 3004 aec_dump_consumers_.push_back(id);
2993 3005
2994 if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) { 3006 if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) {
2995 base::FilePath file_with_extensions = GetAecDumpFilePathWithExtensions( 3007 base::FilePath file_with_extensions = GetAecDumpFilePathWithExtensions(
2996 WebRTCInternals::GetInstance()->GetAudioDebugRecordingsFilePath()); 3008 WebRTCInternals::GetInstance()->GetAudioDebugRecordingsFilePath());
2997 EnableAecDumpForId(file_with_extensions, id); 3009 EnableAecDumpForId(file_with_extensions, id);
2998 } 3010 }
3011 if (override_aec3_) {
3012 Send(new AudioProcessingMsg_EnableAec3(id, *override_aec3_));
3013 }
2999 } 3014 }
3000 3015
3001 void RenderProcessHostImpl::UnregisterAecDumpConsumerOnUIThread(int id) { 3016 void RenderProcessHostImpl::UnregisterAecDumpConsumerOnUIThread(int id) {
3002 DCHECK_CURRENTLY_ON(BrowserThread::UI); 3017 DCHECK_CURRENTLY_ON(BrowserThread::UI);
3003 for (std::vector<int>::iterator it = aec_dump_consumers_.begin(); 3018 for (std::vector<int>::iterator it = aec_dump_consumers_.begin();
3004 it != aec_dump_consumers_.end(); ++it) { 3019 it != aec_dump_consumers_.end(); ++it) {
3005 if (*it == id) { 3020 if (*it == id) {
3006 aec_dump_consumers_.erase(it); 3021 aec_dump_consumers_.erase(it);
3007 break; 3022 break;
3008 } 3023 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
3060 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3075 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3061 3076
3062 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3077 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3063 // Capture the error message in a crash key value. 3078 // Capture the error message in a crash key value.
3064 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3079 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3065 bad_message::ReceivedBadMessage(render_process_id, 3080 bad_message::ReceivedBadMessage(render_process_id,
3066 bad_message::RPH_MOJO_PROCESS_ERROR); 3081 bad_message::RPH_MOJO_PROCESS_ERROR);
3067 } 3082 }
3068 3083
3069 } // namespace content 3084 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698