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 <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "components/tracing/tracing_switches.h" | 24 #include "components/tracing/tracing_switches.h" |
25 #include "content/browser/browser_child_process_host_impl.h" | 25 #include "content/browser/browser_child_process_host_impl.h" |
26 #include "content/browser/gpu/compositor_util.h" | 26 #include "content/browser/gpu/compositor_util.h" |
27 #include "content/browser/gpu/gpu_data_manager_impl.h" | 27 #include "content/browser/gpu/gpu_data_manager_impl.h" |
28 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 28 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
29 #include "content/browser/gpu/gpu_surface_tracker.h" | 29 #include "content/browser/gpu/gpu_surface_tracker.h" |
30 #include "content/browser/gpu/shader_disk_cache.h" | 30 #include "content/browser/gpu/shader_disk_cache.h" |
31 #include "content/browser/mojo/mojo_application_host.h" | 31 #include "content/browser/mojo/mojo_application_host.h" |
32 #include "content/browser/renderer_host/render_widget_host_impl.h" | 32 #include "content/browser/renderer_host/render_widget_host_impl.h" |
33 #include "content/common/child_process_host_impl.h" | 33 #include "content/common/child_process_host_impl.h" |
34 #include "content/common/gpu/gpu_messages.h" | 34 #include "content/common/gpu/gpu_browser_messages.h" |
35 #include "content/common/in_process_child_thread_params.h" | 35 #include "content/common/in_process_child_thread_params.h" |
36 #include "content/common/view_messages.h" | 36 #include "content/common/view_messages.h" |
37 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
38 #include "content/public/browser/content_browser_client.h" | 38 #include "content/public/browser/content_browser_client.h" |
39 #include "content/public/browser/render_process_host.h" | 39 #include "content/public/browser/render_process_host.h" |
40 #include "content/public/browser/render_widget_host_view.h" | 40 #include "content/public/browser/render_widget_host_view.h" |
41 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" | 41 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" |
42 #include "content/public/common/content_client.h" | 42 #include "content/public/common/content_client.h" |
43 #include "content/public/common/content_switches.h" | 43 #include "content/public/common/content_switches.h" |
44 #include "content/public/common/result_codes.h" | 44 #include "content/public/common/result_codes.h" |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 DCHECK(CalledOnValidThread()); | 682 DCHECK(CalledOnValidThread()); |
683 TRACE_EVENT0("gpu", "GpuProcessHost::EstablishGpuChannel"); | 683 TRACE_EVENT0("gpu", "GpuProcessHost::EstablishGpuChannel"); |
684 | 684 |
685 // If GPU features are already blacklisted, no need to establish the channel. | 685 // If GPU features are already blacklisted, no need to establish the channel. |
686 if (!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) { | 686 if (!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) { |
687 DVLOG(1) << "GPU blacklisted, refusing to open a GPU channel."; | 687 DVLOG(1) << "GPU blacklisted, refusing to open a GPU channel."; |
688 callback.Run(IPC::ChannelHandle(), gpu::GPUInfo()); | 688 callback.Run(IPC::ChannelHandle(), gpu::GPUInfo()); |
689 return; | 689 return; |
690 } | 690 } |
691 | 691 |
692 GpuMsg_EstablishChannel_Params params; | 692 EstablishChannelParams params; |
693 params.client_id = client_id; | 693 params.client_id = client_id; |
694 params.client_tracing_id = client_tracing_id; | 694 params.client_tracing_id = client_tracing_id; |
695 params.preempts = preempts; | 695 params.preempts = preempts; |
696 params.allow_view_command_buffers = allow_view_command_buffers; | 696 params.allow_view_command_buffers = allow_view_command_buffers; |
697 params.allow_real_time_streams = allow_real_time_streams; | 697 params.allow_real_time_streams = allow_real_time_streams; |
698 if (Send(new GpuMsg_EstablishChannel(params))) { | 698 if (Send(new GpuMsg_EstablishChannel(params))) { |
699 channel_requests_.push(callback); | 699 channel_requests_.push(callback); |
700 } else { | 700 } else { |
701 DVLOG(1) << "Failed to send GpuMsg_EstablishChannel."; | 701 DVLOG(1) << "Failed to send GpuMsg_EstablishChannel."; |
702 callback.Run(IPC::ChannelHandle(), gpu::GPUInfo()); | 702 callback.Run(IPC::ChannelHandle(), gpu::GPUInfo()); |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1147 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1148 ClientIdToShaderCacheMap::iterator iter = | 1148 ClientIdToShaderCacheMap::iterator iter = |
1149 client_id_to_shader_cache_.find(client_id); | 1149 client_id_to_shader_cache_.find(client_id); |
1150 // If the cache doesn't exist then this is an off the record profile. | 1150 // If the cache doesn't exist then this is an off the record profile. |
1151 if (iter == client_id_to_shader_cache_.end()) | 1151 if (iter == client_id_to_shader_cache_.end()) |
1152 return; | 1152 return; |
1153 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1153 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1154 } | 1154 } |
1155 | 1155 |
1156 } // namespace content | 1156 } // namespace content |
OLD | NEW |