| 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 14 matching lines...) Expand all Loading... |
| 25 #include "base/threading/thread.h" | 25 #include "base/threading/thread.h" |
| 26 #include "base/threading/thread_task_runner_handle.h" | 26 #include "base/threading/thread_task_runner_handle.h" |
| 27 #include "base/trace_event/trace_event.h" | 27 #include "base/trace_event/trace_event.h" |
| 28 #include "build/build_config.h" | 28 #include "build/build_config.h" |
| 29 #include "components/tracing/common/tracing_switches.h" | 29 #include "components/tracing/common/tracing_switches.h" |
| 30 #include "content/browser/browser_child_process_host_impl.h" | 30 #include "content/browser/browser_child_process_host_impl.h" |
| 31 #include "content/browser/gpu/compositor_util.h" | 31 #include "content/browser/gpu/compositor_util.h" |
| 32 #include "content/browser/gpu/gpu_data_manager_impl.h" | 32 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 33 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 33 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 34 #include "content/browser/gpu/shader_disk_cache.h" | 34 #include "content/browser/gpu/shader_disk_cache.h" |
| 35 #include "content/browser/mojo/mojo_child_connection.h" | |
| 36 #include "content/browser/mojo/mojo_shell_context.h" | 35 #include "content/browser/mojo/mojo_shell_context.h" |
| 37 #include "content/browser/renderer_host/render_widget_host_impl.h" | 36 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 38 #include "content/common/child_process_host_impl.h" | 37 #include "content/common/child_process_host_impl.h" |
| 39 #include "content/common/establish_channel_params.h" | 38 #include "content/common/establish_channel_params.h" |
| 40 #include "content/common/gpu_host_messages.h" | 39 #include "content/common/gpu_host_messages.h" |
| 41 #include "content/common/in_process_child_thread_params.h" | 40 #include "content/common/in_process_child_thread_params.h" |
| 42 #include "content/common/mojo/constants.h" | 41 #include "content/common/mojo/constants.h" |
| 42 #include "content/common/mojo/mojo_child_connection.h" |
| 43 #include "content/common/view_messages.h" | 43 #include "content/common/view_messages.h" |
| 44 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
| 45 #include "content/public/browser/content_browser_client.h" | 45 #include "content/public/browser/content_browser_client.h" |
| 46 #include "content/public/browser/gpu_utils.h" | 46 #include "content/public/browser/gpu_utils.h" |
| 47 #include "content/public/browser/render_process_host.h" | 47 #include "content/public/browser/render_process_host.h" |
| 48 #include "content/public/browser/render_widget_host_view.h" | 48 #include "content/public/browser/render_widget_host_view.h" |
| 49 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" | 49 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" |
| 50 #include "content/public/common/connection_filter.h" | 50 #include "content/public/common/connection_filter.h" |
| 51 #include "content/public/common/content_client.h" | 51 #include "content/public/common/content_client.h" |
| 52 #include "content/public/common/content_switches.h" | 52 #include "content/public/common/content_switches.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 582 |
| 583 process_->GetHost()->CreateChannelMojo(); | 583 process_->GetHost()->CreateChannelMojo(); |
| 584 | 584 |
| 585 gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine(); | 585 gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine(); |
| 586 if (in_process_) { | 586 if (in_process_) { |
| 587 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 587 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 588 DCHECK(g_gpu_main_thread_factory); | 588 DCHECK(g_gpu_main_thread_factory); |
| 589 in_process_gpu_thread_.reset(g_gpu_main_thread_factory( | 589 in_process_gpu_thread_.reset(g_gpu_main_thread_factory( |
| 590 InProcessChildThreadParams( | 590 InProcessChildThreadParams( |
| 591 std::string(), base::ThreadTaskRunnerHandle::Get(), | 591 std::string(), base::ThreadTaskRunnerHandle::Get(), |
| 592 std::string(), | |
| 593 process_->child_connection()->service_token()), | 592 process_->child_connection()->service_token()), |
| 594 gpu_preferences)); | 593 gpu_preferences)); |
| 595 base::Thread::Options options; | 594 base::Thread::Options options; |
| 596 #if defined(OS_WIN) | 595 #if defined(OS_WIN) |
| 597 // WGL needs to create its own window and pump messages on it. | 596 // WGL needs to create its own window and pump messages on it. |
| 598 options.message_loop_type = base::MessageLoop::TYPE_UI; | 597 options.message_loop_type = base::MessageLoop::TYPE_UI; |
| 599 #endif | 598 #endif |
| 600 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 599 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 601 options.priority = base::ThreadPriority::DISPLAY; | 600 options.priority = base::ThreadPriority::DISPLAY; |
| 602 #endif | 601 #endif |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1188 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1190 ClientIdToShaderCacheMap::iterator iter = | 1189 ClientIdToShaderCacheMap::iterator iter = |
| 1191 client_id_to_shader_cache_.find(client_id); | 1190 client_id_to_shader_cache_.find(client_id); |
| 1192 // 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. |
| 1193 if (iter == client_id_to_shader_cache_.end()) | 1192 if (iter == client_id_to_shader_cache_.end()) |
| 1194 return; | 1193 return; |
| 1195 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1194 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1196 } | 1195 } |
| 1197 | 1196 |
| 1198 } // namespace content | 1197 } // namespace content |
| OLD | NEW |