| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 RouteOnUIThread(GpuHostMsg_OnLogMessage( | 815 RouteOnUIThread(GpuHostMsg_OnLogMessage( |
| 816 logging::LOG_WARNING, "WARNING", | 816 logging::LOG_WARNING, "WARNING", |
| 817 "Received a ChannelEstablished message but no requests in queue.")); | 817 "Received a ChannelEstablished message but no requests in queue.")); |
| 818 return; | 818 return; |
| 819 } | 819 } |
| 820 EstablishChannelRequest request = channel_requests_.front(); | 820 EstablishChannelRequest request = channel_requests_.front(); |
| 821 channel_requests_.pop(); | 821 channel_requests_.pop(); |
| 822 | 822 |
| 823 // Currently if any of the GPU features are blacklisted, we don't establish a | 823 // Currently if any of the GPU features are blacklisted, we don't establish a |
| 824 // GPU channel. | 824 // GPU channel. |
| 825 if (!channel_handle.name.empty() && | 825 if (channel_handle.mojo_handle.is_valid() && |
| 826 !GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) { | 826 !GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) { |
| 827 Send(new GpuMsg_CloseChannel(request.client_id)); | 827 Send(new GpuMsg_CloseChannel(request.client_id)); |
| 828 request.callback.Run(IPC::ChannelHandle(), gpu::GPUInfo()); | 828 request.callback.Run(IPC::ChannelHandle(), gpu::GPUInfo()); |
| 829 RouteOnUIThread( | 829 RouteOnUIThread( |
| 830 GpuHostMsg_OnLogMessage(logging::LOG_WARNING, "WARNING", | 830 GpuHostMsg_OnLogMessage(logging::LOG_WARNING, "WARNING", |
| 831 "Hardware acceleration is unavailable.")); | 831 "Hardware acceleration is unavailable.")); |
| 832 return; | 832 return; |
| 833 } | 833 } |
| 834 | 834 |
| 835 request.callback.Run(channel_handle, gpu_info_); | 835 request.callback.Run(channel_handle, gpu_info_); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1188 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1189 ClientIdToShaderCacheMap::iterator iter = | 1189 ClientIdToShaderCacheMap::iterator iter = |
| 1190 client_id_to_shader_cache_.find(client_id); | 1190 client_id_to_shader_cache_.find(client_id); |
| 1191 // If the cache doesn't exist then this is an off the record profile. | 1191 // If the cache doesn't exist then this is an off the record profile. |
| 1192 if (iter == client_id_to_shader_cache_.end()) | 1192 if (iter == client_id_to_shader_cache_.end()) |
| 1193 return; | 1193 return; |
| 1194 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1194 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 } // namespace content | 1197 } // namespace content |
| OLD | NEW |