| 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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 #else | 974 #else |
| 975 int child_flags = ChildProcessHost::CHILD_NORMAL; | 975 int child_flags = ChildProcessHost::CHILD_NORMAL; |
| 976 #endif | 976 #endif |
| 977 | 977 |
| 978 base::FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); | 978 base::FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); |
| 979 if (exe_path.empty()) | 979 if (exe_path.empty()) |
| 980 return false; | 980 return false; |
| 981 | 981 |
| 982 base::CommandLine* cmd_line = new base::CommandLine(exe_path); | 982 base::CommandLine* cmd_line = new base::CommandLine(exe_path); |
| 983 #endif | 983 #endif |
| 984 BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(cmd_line); | |
| 985 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); | 984 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); |
| 986 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); | 985 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
| 987 cmd_line->AppendSwitchASCII(switches::kMojoApplicationChannelToken, | 986 cmd_line->AppendSwitchASCII(switches::kMojoApplicationChannelToken, |
| 988 mojo_application_host_->GetToken()); | 987 mojo_application_host_->GetToken()); |
| 988 BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(cmd_line); |
| 989 | 989 |
| 990 #if defined(OS_WIN) | 990 #if defined(OS_WIN) |
| 991 if (GetContentClient()->browser()->ShouldUseWindowsPrefetchArgument()) | 991 if (GetContentClient()->browser()->ShouldUseWindowsPrefetchArgument()) |
| 992 cmd_line->AppendArg(switches::kPrefetchArgumentGpu); | 992 cmd_line->AppendArg(switches::kPrefetchArgumentGpu); |
| 993 #endif // defined(OS_WIN) | 993 #endif // defined(OS_WIN) |
| 994 | 994 |
| 995 if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED) | 995 if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED) |
| 996 cmd_line->AppendSwitch(switches::kDisableGpuSandbox); | 996 cmd_line->AppendSwitch(switches::kDisableGpuSandbox); |
| 997 | 997 |
| 998 // TODO(penghuang): Replace all GPU related switches with GpuPreferences. | 998 // TODO(penghuang): Replace all GPU related switches with GpuPreferences. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1172 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1173 ClientIdToShaderCacheMap::iterator iter = | 1173 ClientIdToShaderCacheMap::iterator iter = |
| 1174 client_id_to_shader_cache_.find(client_id); | 1174 client_id_to_shader_cache_.find(client_id); |
| 1175 // If the cache doesn't exist then this is an off the record profile. | 1175 // If the cache doesn't exist then this is an off the record profile. |
| 1176 if (iter == client_id_to_shader_cache_.end()) | 1176 if (iter == client_id_to_shader_cache_.end()) |
| 1177 return; | 1177 return; |
| 1178 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1178 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 } // namespace content | 1181 } // namespace content |
| OLD | NEW |