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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "content/public/common/mojo_channel_switches.h" | 52 #include "content/public/common/mojo_channel_switches.h" |
53 #include "content/public/common/mojo_shell_connection.h" | 53 #include "content/public/common/mojo_shell_connection.h" |
54 #include "content/public/common/result_codes.h" | 54 #include "content/public/common/result_codes.h" |
55 #include "content/public/common/sandbox_type.h" | 55 #include "content/public/common/sandbox_type.h" |
56 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 56 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
57 #include "content/public/common/service_names.h" | 57 #include "content/public/common/service_names.h" |
58 #include "gpu/command_buffer/service/gpu_preferences.h" | 58 #include "gpu/command_buffer/service/gpu_preferences.h" |
59 #include "gpu/command_buffer/service/gpu_switches.h" | 59 #include "gpu/command_buffer/service/gpu_switches.h" |
60 #include "gpu/ipc/service/switches.h" | 60 #include "gpu/ipc/service/switches.h" |
61 #include "ipc/ipc_channel_handle.h" | 61 #include "ipc/ipc_channel_handle.h" |
62 #include "ipc/ipc_switches.h" | |
63 #include "ipc/message_filter.h" | 62 #include "ipc/message_filter.h" |
64 #include "media/base/media_switches.h" | 63 #include "media/base/media_switches.h" |
65 #include "mojo/edk/embedder/embedder.h" | 64 #include "mojo/edk/embedder/embedder.h" |
66 #include "services/shell/public/cpp/connection.h" | 65 #include "services/shell/public/cpp/connection.h" |
67 #include "services/shell/public/cpp/interface_provider.h" | 66 #include "services/shell/public/cpp/interface_provider.h" |
68 #include "services/shell/runner/common/client_util.h" | 67 #include "services/shell/runner/common/client_util.h" |
69 #include "ui/base/ui_base_switches.h" | 68 #include "ui/base/ui_base_switches.h" |
70 #include "ui/events/latency_info.h" | 69 #include "ui/events/latency_info.h" |
71 #include "ui/gl/gl_switches.h" | 70 #include "ui/gl/gl_switches.h" |
72 | 71 |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 } | 566 } |
568 | 567 |
569 process_->GetHost()->CreateChannelMojo(); | 568 process_->GetHost()->CreateChannelMojo(); |
570 | 569 |
571 gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine(); | 570 gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine(); |
572 if (in_process_) { | 571 if (in_process_) { |
573 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 572 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
574 DCHECK(g_gpu_main_thread_factory); | 573 DCHECK(g_gpu_main_thread_factory); |
575 in_process_gpu_thread_.reset(g_gpu_main_thread_factory( | 574 in_process_gpu_thread_.reset(g_gpu_main_thread_factory( |
576 InProcessChildThreadParams( | 575 InProcessChildThreadParams( |
577 std::string(), base::ThreadTaskRunnerHandle::Get(), | 576 base::ThreadTaskRunnerHandle::Get(), |
578 process_->child_connection()->service_token()), | 577 process_->child_connection()->service_token()), |
579 gpu_preferences)); | 578 gpu_preferences)); |
580 base::Thread::Options options; | 579 base::Thread::Options options; |
581 #if defined(OS_WIN) | 580 #if defined(OS_WIN) |
582 // WGL needs to create its own window and pump messages on it. | 581 // WGL needs to create its own window and pump messages on it. |
583 options.message_loop_type = base::MessageLoop::TYPE_UI; | 582 options.message_loop_type = base::MessageLoop::TYPE_UI; |
584 #endif | 583 #endif |
585 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 584 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
586 options.priority = base::ThreadPriority::DISPLAY; | 585 options.priority = base::ThreadPriority::DISPLAY; |
587 #endif | 586 #endif |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1164 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1166 ClientIdToShaderCacheMap::iterator iter = | 1165 ClientIdToShaderCacheMap::iterator iter = |
1167 client_id_to_shader_cache_.find(client_id); | 1166 client_id_to_shader_cache_.find(client_id); |
1168 // If the cache doesn't exist then this is an off the record profile. | 1167 // If the cache doesn't exist then this is an off the record profile. |
1169 if (iter == client_id_to_shader_cache_.end()) | 1168 if (iter == client_id_to_shader_cache_.end()) |
1170 return; | 1169 return; |
1171 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1170 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1172 } | 1171 } |
1173 | 1172 |
1174 } // namespace content | 1173 } // namespace content |
OLD | NEW |