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

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

Issue 140633004: Reland CL to implement browser-side logging to WebRtc log. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: These are the changes that should fix crbug.com/338848 Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 void RenderProcessHostImpl::DisableAecDump() { 1509 void RenderProcessHostImpl::DisableAecDump() {
1510 // Posting on the FILE thread and then replying back on the UI thread is only 1510 // Posting on the FILE thread and then replying back on the UI thread is only
1511 // for avoiding races between enable and disable. Nothing is done on the FILE 1511 // for avoiding races between enable and disable. Nothing is done on the FILE
1512 // thread. 1512 // thread.
1513 BrowserThread::PostTaskAndReply( 1513 BrowserThread::PostTaskAndReply(
1514 BrowserThread::FILE, FROM_HERE, 1514 BrowserThread::FILE, FROM_HERE,
1515 base::Bind(&DisableAecDumpOnFileThread), 1515 base::Bind(&DisableAecDumpOnFileThread),
1516 base::Bind(&RenderProcessHostImpl::SendDisableAecDumpToRenderer, 1516 base::Bind(&RenderProcessHostImpl::SendDisableAecDumpToRenderer,
1517 weak_factory_.GetWeakPtr())); 1517 weak_factory_.GetWeakPtr()));
1518 } 1518 }
1519
1520 void RenderProcessHostImpl::SetWebRtcLogMessageCallback(
1521 base::Callback<void(const std::string&)> callback) {
1522 webrtc_log_message_callback_ = callback;
1523 }
1519 #endif 1524 #endif
1520 1525
1521 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() { 1526 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() {
1522 return channel_.get(); 1527 return channel_.get();
1523 } 1528 }
1524 1529
1525 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) { 1530 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) {
1526 channel_->AddFilter(filter->GetFilter()); 1531 channel_->AddFilter(filter->GetFilter());
1527 } 1532 }
1528 1533
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 1880
1876 void RenderProcessHostImpl::EndFrameSubscription(int route_id) { 1881 void RenderProcessHostImpl::EndFrameSubscription(int route_id) {
1877 if (!gpu_message_filter_) 1882 if (!gpu_message_filter_)
1878 return; 1883 return;
1879 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( 1884 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(
1880 &GpuMessageFilter::EndFrameSubscription, 1885 &GpuMessageFilter::EndFrameSubscription,
1881 gpu_message_filter_, 1886 gpu_message_filter_,
1882 route_id)); 1887 route_id));
1883 } 1888 }
1884 1889
1890 #if defined(ENABLE_WEBRTC)
1891 void RenderProcessHostImpl::WebRtcLogMessage(const std::string& message) {
1892 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1893 if (!webrtc_log_message_callback_.is_null())
1894 webrtc_log_message_callback_.Run(message);
1895 }
1896 #endif
1897
1885 void RenderProcessHostImpl::OnShutdownRequest() { 1898 void RenderProcessHostImpl::OnShutdownRequest() {
1886 // Don't shut down if there are active RenderViews, or if there are pending 1899 // Don't shut down if there are active RenderViews, or if there are pending
1887 // RenderViews being swapped back in. 1900 // RenderViews being swapped back in.
1888 // In single process mode, we never shutdown the renderer. 1901 // In single process mode, we never shutdown the renderer.
1889 int num_active_views = GetActiveViewCount(); 1902 int num_active_views = GetActiveViewCount();
1890 if (pending_views_ || num_active_views > 0 || run_renderer_in_process()) 1903 if (pending_views_ || num_active_views > 0 || run_renderer_in_process())
1891 return; 1904 return;
1892 1905
1893 // Notify any contents that might have swapped out renderers from this 1906 // Notify any contents that might have swapped out renderers from this
1894 // process. They should not attempt to swap them back in. 1907 // process. They should not attempt to swap them back in.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 return; 2035 return;
2023 Send(new MediaStreamMsg_EnableAecDump(file_for_transit)); 2036 Send(new MediaStreamMsg_EnableAecDump(file_for_transit));
2024 } 2037 }
2025 2038
2026 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() { 2039 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() {
2027 Send(new MediaStreamMsg_DisableAecDump()); 2040 Send(new MediaStreamMsg_DisableAecDump());
2028 } 2041 }
2029 #endif 2042 #endif
2030 2043
2031 } // namespace content 2044 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698