| OLD | NEW |
| 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 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1874 } | 1874 } |
| 1875 delayed_cleanup_needed_ = false; | 1875 delayed_cleanup_needed_ = false; |
| 1876 | 1876 |
| 1877 // Records the time when the process starts surviving for workers for UMA. | 1877 // Records the time when the process starts surviving for workers for UMA. |
| 1878 if (listeners_.IsEmpty() && worker_ref_count_ > 0 && | 1878 if (listeners_.IsEmpty() && worker_ref_count_ > 0 && |
| 1879 survive_for_worker_start_time_.is_null()) { | 1879 survive_for_worker_start_time_.is_null()) { |
| 1880 survive_for_worker_start_time_ = base::TimeTicks::Now(); | 1880 survive_for_worker_start_time_ = base::TimeTicks::Now(); |
| 1881 } | 1881 } |
| 1882 | 1882 |
| 1883 #if defined(ENABLE_WEBRTC) | 1883 #if defined(ENABLE_WEBRTC) |
| 1884 if (is_initialized_) { | 1884 if (is_initialized_) |
| 1885 BrowserMainLoop::GetInstance()->media_stream_manager()-> | 1885 ClearWebRtcLogMessageCallback(); |
| 1886 UnregisterNativeLogCallback(GetID()); | |
| 1887 } | |
| 1888 #endif | 1886 #endif |
| 1889 | 1887 |
| 1890 // When there are no other owners of this object, we can delete ourselves. | 1888 // When there are no other owners of this object, we can delete ourselves. |
| 1891 if (listeners_.IsEmpty() && worker_ref_count_ == 0) { | 1889 if (listeners_.IsEmpty() && worker_ref_count_ == 0) { |
| 1892 if (!survive_for_worker_start_time_.is_null()) { | 1890 if (!survive_for_worker_start_time_.is_null()) { |
| 1893 UMA_HISTOGRAM_LONG_TIMES( | 1891 UMA_HISTOGRAM_LONG_TIMES( |
| 1894 "SharedWorker.RendererSurviveForWorkerTime", | 1892 "SharedWorker.RendererSurviveForWorkerTime", |
| 1895 base::TimeTicks::Now() - survive_for_worker_start_time_); | 1893 base::TimeTicks::Now() - survive_for_worker_start_time_); |
| 1896 } | 1894 } |
| 1897 | 1895 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2054 } | 2052 } |
| 2055 | 2053 |
| 2056 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( | 2054 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( |
| 2057 base::Callback<void(const std::string&)> callback) { | 2055 base::Callback<void(const std::string&)> callback) { |
| 2058 #if defined(ENABLE_WEBRTC) | 2056 #if defined(ENABLE_WEBRTC) |
| 2059 BrowserMainLoop::GetInstance()->media_stream_manager()-> | 2057 BrowserMainLoop::GetInstance()->media_stream_manager()-> |
| 2060 RegisterNativeLogCallback(GetID(), callback); | 2058 RegisterNativeLogCallback(GetID(), callback); |
| 2061 #endif | 2059 #endif |
| 2062 } | 2060 } |
| 2063 | 2061 |
| 2062 void RenderProcessHostImpl::ClearWebRtcLogMessageCallback() { |
| 2063 #if defined(ENABLE_WEBRTC) |
| 2064 BrowserMainLoop::GetInstance() |
| 2065 ->media_stream_manager() |
| 2066 ->UnregisterNativeLogCallback(GetID()); |
| 2067 #endif |
| 2068 } |
| 2069 |
| 2064 RenderProcessHostImpl::WebRtcStopRtpDumpCallback | 2070 RenderProcessHostImpl::WebRtcStopRtpDumpCallback |
| 2065 RenderProcessHostImpl::StartRtpDump( | 2071 RenderProcessHostImpl::StartRtpDump( |
| 2066 bool incoming, | 2072 bool incoming, |
| 2067 bool outgoing, | 2073 bool outgoing, |
| 2068 const WebRtcRtpPacketCallback& packet_callback) { | 2074 const WebRtcRtpPacketCallback& packet_callback) { |
| 2069 if (!p2p_socket_dispatcher_host_.get()) | 2075 if (!p2p_socket_dispatcher_host_.get()) |
| 2070 return WebRtcStopRtpDumpCallback(); | 2076 return WebRtcStopRtpDumpCallback(); |
| 2071 | 2077 |
| 2072 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 2078 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 2073 base::Bind(&P2PSocketDispatcherHost::StartRtpDump, | 2079 base::Bind(&P2PSocketDispatcherHost::StartRtpDump, |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2788 | 2794 |
| 2789 // Skip widgets in other processes. | 2795 // Skip widgets in other processes. |
| 2790 if (rvh->GetProcess()->GetID() != GetID()) | 2796 if (rvh->GetProcess()->GetID() != GetID()) |
| 2791 continue; | 2797 continue; |
| 2792 | 2798 |
| 2793 rvh->OnWebkitPreferencesChanged(); | 2799 rvh->OnWebkitPreferencesChanged(); |
| 2794 } | 2800 } |
| 2795 } | 2801 } |
| 2796 | 2802 |
| 2797 } // namespace content | 2803 } // namespace content |
| OLD | NEW |