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