| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 #include "third_party/skia/include/core/SkBitmap.h" | 156 #include "third_party/skia/include/core/SkBitmap.h" |
| 157 | 157 |
| 158 extern bool g_exited_main_message_loop; | 158 extern bool g_exited_main_message_loop; |
| 159 | 159 |
| 160 static const char* kSiteProcessMapKeyName = "content_site_process_map"; | 160 static const char* kSiteProcessMapKeyName = "content_site_process_map"; |
| 161 | 161 |
| 162 namespace content { | 162 namespace content { |
| 163 namespace { | 163 namespace { |
| 164 | 164 |
| 165 // Maximal number of LatencyInfo that can be contained in |
| 166 // ViewHostMsg_CompositorSurfaceBuffersSwapped_Params. |
| 167 const unsigned int kMaxLatencyInfoNumber = 100; |
| 168 |
| 165 void CacheShaderInfo(int32 id, base::FilePath path) { | 169 void CacheShaderInfo(int32 id, base::FilePath path) { |
| 166 ShaderCacheFactory::GetInstance()->SetCacheInfo(id, path); | 170 ShaderCacheFactory::GetInstance()->SetCacheInfo(id, path); |
| 167 } | 171 } |
| 168 | 172 |
| 169 void RemoveShaderInfo(int32 id) { | 173 void RemoveShaderInfo(int32 id) { |
| 170 ShaderCacheFactory::GetInstance()->RemoveCacheInfo(id); | 174 ShaderCacheFactory::GetInstance()->RemoveCacheInfo(id); |
| 171 } | 175 } |
| 172 | 176 |
| 173 net::URLRequestContext* GetRequestContext( | 177 net::URLRequestContext* GetRequestContext( |
| 174 scoped_refptr<net::URLRequestContextGetter> request_context, | 178 scoped_refptr<net::URLRequestContextGetter> request_context, |
| (...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1980 } | 1984 } |
| 1981 | 1985 |
| 1982 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 1986 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
| 1983 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); | 1987 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); |
| 1984 } | 1988 } |
| 1985 | 1989 |
| 1986 void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost( | 1990 void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost( |
| 1987 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params) { | 1991 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params) { |
| 1988 TRACE_EVENT0("renderer_host", | 1992 TRACE_EVENT0("renderer_host", |
| 1989 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1993 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
| 1994 if (params.latency_info.size() > kMaxLatencyInfoNumber) { |
| 1995 LOG(ERROR) << "ViewHostMsg_CompositorSurfaceBuffersSwapped LatencyInfo" |
| 1996 << " size " << params.latency_info.size() << " is too big."; |
| 1997 return; |
| 1998 } |
| 1990 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1999 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
| 1991 ack_params.sync_point = 0; | 2000 ack_params.sync_point = 0; |
| 1992 RenderWidgetHostImpl::AcknowledgeBufferPresent(params.route_id, | 2001 RenderWidgetHostImpl::AcknowledgeBufferPresent(params.route_id, |
| 1993 params.gpu_process_host_id, | 2002 params.gpu_process_host_id, |
| 1994 ack_params); | 2003 ack_params); |
| 1995 } | 2004 } |
| 1996 | 2005 |
| 1997 void RenderProcessHostImpl::OnGpuSwitching() { | 2006 void RenderProcessHostImpl::OnGpuSwitching() { |
| 1998 // We are updating all widgets including swapped out ones. | 2007 // We are updating all widgets including swapped out ones. |
| 1999 scoped_ptr<RenderWidgetHostIterator> widgets( | 2008 scoped_ptr<RenderWidgetHostIterator> widgets( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2018 return; | 2027 return; |
| 2019 Send(new MediaStreamMsg_EnableAecDump(file_for_transit)); | 2028 Send(new MediaStreamMsg_EnableAecDump(file_for_transit)); |
| 2020 } | 2029 } |
| 2021 | 2030 |
| 2022 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() { | 2031 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() { |
| 2023 Send(new MediaStreamMsg_DisableAecDump()); | 2032 Send(new MediaStreamMsg_DisableAecDump()); |
| 2024 } | 2033 } |
| 2025 #endif | 2034 #endif |
| 2026 | 2035 |
| 2027 } // namespace content | 2036 } // namespace content |
| OLD | NEW |