| 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 #include "content/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 | 763 |
| 764 Send(new GpuMsg_DeleteImage(client_id, image_id, sync_point)); | 764 Send(new GpuMsg_DeleteImage(client_id, image_id, sync_point)); |
| 765 } | 765 } |
| 766 | 766 |
| 767 void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) { | 767 void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) { |
| 768 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result); | 768 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result); |
| 769 initialized_ = result; | 769 initialized_ = result; |
| 770 | 770 |
| 771 if (!initialized_) | 771 if (!initialized_) |
| 772 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); | 772 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); |
| 773 else if (!in_process_) |
| 774 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); |
| 773 } | 775 } |
| 774 | 776 |
| 775 void GpuProcessHost::OnChannelEstablished( | 777 void GpuProcessHost::OnChannelEstablished( |
| 776 const IPC::ChannelHandle& channel_handle) { | 778 const IPC::ChannelHandle& channel_handle) { |
| 777 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelEstablished"); | 779 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelEstablished"); |
| 778 | 780 |
| 779 if (channel_requests_.empty()) { | 781 if (channel_requests_.empty()) { |
| 780 // This happens when GPU process is compromised. | 782 // This happens when GPU process is compromised. |
| 781 RouteOnUIThread(GpuHostMsg_OnLogMessage( | 783 RouteOnUIThread(GpuHostMsg_OnLogMessage( |
| 782 logging::LOG_WARNING, | 784 logging::LOG_WARNING, |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1238 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1237 ClientIdToShaderCacheMap::iterator iter = | 1239 ClientIdToShaderCacheMap::iterator iter = |
| 1238 client_id_to_shader_cache_.find(client_id); | 1240 client_id_to_shader_cache_.find(client_id); |
| 1239 // If the cache doesn't exist then this is an off the record profile. | 1241 // If the cache doesn't exist then this is an off the record profile. |
| 1240 if (iter == client_id_to_shader_cache_.end()) | 1242 if (iter == client_id_to_shader_cache_.end()) |
| 1241 return; | 1243 return; |
| 1242 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1244 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1243 } | 1245 } |
| 1244 | 1246 |
| 1245 } // namespace content | 1247 } // namespace content |
| OLD | NEW |