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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
745 | 745 |
746 Send(new GpuMsg_DeleteImage(client_id, image_id, sync_point)); | 746 Send(new GpuMsg_DeleteImage(client_id, image_id, sync_point)); |
747 } | 747 } |
748 | 748 |
749 void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) { | 749 void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) { |
750 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result); | 750 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result); |
751 initialized_ = result; | 751 initialized_ = result; |
752 | 752 |
753 if (!initialized_) | 753 if (!initialized_) |
754 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); | 754 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); |
755 else | |
756 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); | |
piman
2014/03/11 21:32:45
This is needed to avoid races.
GpuChildThread send
| |
755 } | 757 } |
756 | 758 |
757 void GpuProcessHost::OnChannelEstablished( | 759 void GpuProcessHost::OnChannelEstablished( |
758 const IPC::ChannelHandle& channel_handle) { | 760 const IPC::ChannelHandle& channel_handle) { |
759 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelEstablished"); | 761 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelEstablished"); |
760 | 762 |
761 if (channel_requests_.empty()) { | 763 if (channel_requests_.empty()) { |
762 // This happens when GPU process is compromised. | 764 // This happens when GPU process is compromised. |
763 RouteOnUIThread(GpuHostMsg_OnLogMessage( | 765 RouteOnUIThread(GpuHostMsg_OnLogMessage( |
764 logging::LOG_WARNING, | 766 logging::LOG_WARNING, |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1223 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1225 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1224 ClientIdToShaderCacheMap::iterator iter = | 1226 ClientIdToShaderCacheMap::iterator iter = |
1225 client_id_to_shader_cache_.find(client_id); | 1227 client_id_to_shader_cache_.find(client_id); |
1226 // If the cache doesn't exist then this is an off the record profile. | 1228 // If the cache doesn't exist then this is an off the record profile. |
1227 if (iter == client_id_to_shader_cache_.end()) | 1229 if (iter == client_id_to_shader_cache_.end()) |
1228 return; | 1230 return; |
1229 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1231 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1230 } | 1232 } |
1231 | 1233 |
1232 } // namespace content | 1234 } // namespace content |
OLD | NEW |