Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: content/browser/gpu/gpu_process_host.cc

Issue 1612663002: Use a valid /prefetch argument when launching a process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bit
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "ui/events/latency_info.h" 53 #include "ui/events/latency_info.h"
54 #include "ui/gl/gl_switches.h" 54 #include "ui/gl/gl_switches.h"
55 55
56 #if defined(OS_ANDROID) 56 #if defined(OS_ANDROID)
57 #include "base/android/build_info.h" 57 #include "base/android/build_info.h"
58 #endif 58 #endif
59 59
60 #if defined(OS_WIN) 60 #if defined(OS_WIN)
61 #include "base/win/windows_version.h" 61 #include "base/win/windows_version.h"
62 #include "content/common/sandbox_win.h" 62 #include "content/common/sandbox_win.h"
63 #include "content/public/common/prefetch_argument_win.h"
63 #include "sandbox/win/src/sandbox_policy.h" 64 #include "sandbox/win/src/sandbox_policy.h"
64 #include "ui/gfx/switches.h" 65 #include "ui/gfx/switches.h"
65 #endif 66 #endif
66 67
67 #if defined(USE_OZONE) 68 #if defined(USE_OZONE)
68 #include "ui/ozone/public/ozone_switches.h" 69 #include "ui/ozone/public/ozone_switches.h"
69 #endif 70 #endif
70 71
71 #if defined(USE_X11) && !defined(OS_CHROMEOS) 72 #if defined(USE_X11) && !defined(OS_CHROMEOS)
72 #include "ui/gfx/x/x11_switches.h" 73 #include "ui/gfx/x/x11_switches.h"
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 1024
1024 base::FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); 1025 base::FilePath exe_path = ChildProcessHost::GetChildPath(child_flags);
1025 if (exe_path.empty()) 1026 if (exe_path.empty())
1026 return false; 1027 return false;
1027 1028
1028 base::CommandLine* cmd_line = new base::CommandLine(exe_path); 1029 base::CommandLine* cmd_line = new base::CommandLine(exe_path);
1029 #endif 1030 #endif
1030 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); 1031 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess);
1031 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); 1032 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
1032 1033
1034 #if defined(OS_WIN)
1035 AddWindowsPrefetchArgument(PREFETCH_ID_GPU, cmd_line);
1036 #endif // defined(OS_WIN)
1037
1033 if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED) 1038 if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED)
1034 cmd_line->AppendSwitch(switches::kDisableGpuSandbox); 1039 cmd_line->AppendSwitch(switches::kDisableGpuSandbox);
1035 1040
1036 // If you want a browser command-line switch passed to the GPU process 1041 // If you want a browser command-line switch passed to the GPU process
1037 // you need to add it to |kSwitchNames| at the beginning of this file. 1042 // you need to add it to |kSwitchNames| at the beginning of this file.
1038 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, 1043 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
1039 arraysize(kSwitchNames)); 1044 arraysize(kSwitchNames));
1040 cmd_line->CopySwitchesFrom( 1045 cmd_line->CopySwitchesFrom(
1041 browser_command_line, switches::kGpuSwitches, switches::kNumGpuSwitches); 1046 browser_command_line, switches::kGpuSwitches, switches::kNumGpuSwitches);
1042 cmd_line->CopySwitchesFrom( 1047 cmd_line->CopySwitchesFrom(
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1228 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1224 ClientIdToShaderCacheMap::iterator iter = 1229 ClientIdToShaderCacheMap::iterator iter =
1225 client_id_to_shader_cache_.find(client_id); 1230 client_id_to_shader_cache_.find(client_id);
1226 // If the cache doesn't exist then this is an off the record profile. 1231 // If the cache doesn't exist then this is an off the record profile.
1227 if (iter == client_id_to_shader_cache_.end()) 1232 if (iter == client_id_to_shader_cache_.end())
1228 return; 1233 return;
1229 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1234 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1230 } 1235 }
1231 1236
1232 } // namespace content 1237 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698