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

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

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

Powered by Google App Engine
This is Rietveld 408576698