| OLD | NEW |
| 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 Loading... |
| 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 } | |
| 1524 #endif | 1519 #endif |
| 1525 | 1520 |
| 1526 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() { | 1521 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() { |
| 1527 return channel_.get(); | 1522 return channel_.get(); |
| 1528 } | 1523 } |
| 1529 | 1524 |
| 1530 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) { | 1525 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) { |
| 1531 channel_->AddFilter(filter->GetFilter()); | 1526 channel_->AddFilter(filter->GetFilter()); |
| 1532 } | 1527 } |
| 1533 | 1528 |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1880 | 1875 |
| 1881 void RenderProcessHostImpl::EndFrameSubscription(int route_id) { | 1876 void RenderProcessHostImpl::EndFrameSubscription(int route_id) { |
| 1882 if (!gpu_message_filter_) | 1877 if (!gpu_message_filter_) |
| 1883 return; | 1878 return; |
| 1884 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( | 1879 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( |
| 1885 &GpuMessageFilter::EndFrameSubscription, | 1880 &GpuMessageFilter::EndFrameSubscription, |
| 1886 gpu_message_filter_, | 1881 gpu_message_filter_, |
| 1887 route_id)); | 1882 route_id)); |
| 1888 } | 1883 } |
| 1889 | 1884 |
| 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 | |
| 1898 void RenderProcessHostImpl::OnShutdownRequest() { | 1885 void RenderProcessHostImpl::OnShutdownRequest() { |
| 1899 // Don't shut down if there are active RenderViews, or if there are pending | 1886 // Don't shut down if there are active RenderViews, or if there are pending |
| 1900 // RenderViews being swapped back in. | 1887 // RenderViews being swapped back in. |
| 1901 // In single process mode, we never shutdown the renderer. | 1888 // In single process mode, we never shutdown the renderer. |
| 1902 int num_active_views = GetActiveViewCount(); | 1889 int num_active_views = GetActiveViewCount(); |
| 1903 if (pending_views_ || num_active_views > 0 || run_renderer_in_process()) | 1890 if (pending_views_ || num_active_views > 0 || run_renderer_in_process()) |
| 1904 return; | 1891 return; |
| 1905 | 1892 |
| 1906 // Notify any contents that might have swapped out renderers from this | 1893 // Notify any contents that might have swapped out renderers from this |
| 1907 // process. They should not attempt to swap them back in. | 1894 // process. They should not attempt to swap them back in. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 return; | 2022 return; |
| 2036 Send(new MediaStreamMsg_EnableAecDump(file_for_transit)); | 2023 Send(new MediaStreamMsg_EnableAecDump(file_for_transit)); |
| 2037 } | 2024 } |
| 2038 | 2025 |
| 2039 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() { | 2026 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() { |
| 2040 Send(new MediaStreamMsg_DisableAecDump()); | 2027 Send(new MediaStreamMsg_DisableAecDump()); |
| 2041 } | 2028 } |
| 2042 #endif | 2029 #endif |
| 2043 | 2030 |
| 2044 } // namespace content | 2031 } // namespace content |
| OLD | NEW |