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

Side by Side Diff: chrome/common/service_process_util.cc

Issue 1595633002: Use valid /prefetch arguments for process launches on Windows. - do not submit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move
Patch Set: format 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 "chrome/common/service_process_util.h" 5 #include "chrome/common/service_process_util.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "chrome/common/chrome_constants.h" 24 #include "chrome/common/chrome_constants.h"
25 #include "chrome/common/chrome_paths.h" 25 #include "chrome/common/chrome_paths.h"
26 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
27 #include "components/cloud_devices/common/cloud_devices_switches.h" 27 #include "components/cloud_devices/common/cloud_devices_switches.h"
28 #include "components/version_info/version_info.h" 28 #include "components/version_info/version_info.h"
29 #include "content/public/common/content_paths.h" 29 #include "content/public/common/content_paths.h"
30 #include "content/public/common/content_switches.h" 30 #include "content/public/common/content_switches.h"
31 #include "google_apis/gaia/gaia_switches.h" 31 #include "google_apis/gaia/gaia_switches.h"
32 #include "ui/base/ui_base_switches.h" 32 #include "ui/base/ui_base_switches.h"
33 33
34 #if defined(OS_WIN)
35 #include "chrome/common/prefetch_argument_win.h"
36 #endif // defined(OS_WIN)
37
34 #if !defined(OS_MACOSX) 38 #if !defined(OS_MACOSX)
35 39
36 namespace { 40 namespace {
37 41
38 // This should be more than enough to hold a version string assuming each part 42 // This should be more than enough to hold a version string assuming each part
39 // of the version string is an int64_t. 43 // of the version string is an int64_t.
40 const uint32_t kMaxVersionStringLength = 256; 44 const uint32_t kMaxVersionStringLength = 256;
41 45
42 // The structure that gets written to shared memory. 46 // The structure that gets written to shared memory.
43 struct ServiceProcessSharedData { 47 struct ServiceProcessSharedData {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return hex_hash + "." + append_str; 157 return hex_hash + "." + append_str;
154 } 158 }
155 159
156 scoped_ptr<base::CommandLine> CreateServiceProcessCommandLine() { 160 scoped_ptr<base::CommandLine> CreateServiceProcessCommandLine() {
157 base::FilePath exe_path; 161 base::FilePath exe_path;
158 PathService::Get(content::CHILD_PROCESS_EXE, &exe_path); 162 PathService::Get(content::CHILD_PROCESS_EXE, &exe_path);
159 DCHECK(!exe_path.empty()) << "Unable to get service process binary name."; 163 DCHECK(!exe_path.empty()) << "Unable to get service process binary name.";
160 scoped_ptr<base::CommandLine> command_line(new base::CommandLine(exe_path)); 164 scoped_ptr<base::CommandLine> command_line(new base::CommandLine(exe_path));
161 command_line->AppendSwitchASCII(switches::kProcessType, 165 command_line->AppendSwitchASCII(switches::kProcessType,
162 switches::kServiceProcess); 166 switches::kServiceProcess);
167 #if defined(OS_WIN)
168 chrome::AddWindowsPrefetchArgument(command_line.get());
169 #endif // defined(OS_WIN)
163 static const char* const kSwitchesToCopy[] = { 170 static const char* const kSwitchesToCopy[] = {
164 switches::kCloudPrintSetupProxy, 171 switches::kCloudPrintSetupProxy,
165 switches::kCloudPrintURL, 172 switches::kCloudPrintURL,
166 switches::kCloudPrintXmppEndpoint, 173 switches::kCloudPrintXmppEndpoint,
167 #if defined(OS_WIN) 174 #if defined(OS_WIN)
168 switches::kEnableCloudPrintXps, 175 switches::kEnableCloudPrintXps,
169 #endif 176 #endif
170 switches::kEnableLogging, 177 switches::kEnableLogging,
171 switches::kIgnoreUrlFetcherCertRequests, 178 switches::kIgnoreUrlFetcherCertRequests,
172 switches::kLang, 179 switches::kLang,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 shared_data->service_process_pid = base::GetCurrentProcId(); 277 shared_data->service_process_pid = base::GetCurrentProcId();
271 shared_mem_service_data_.reset(shared_mem_service_data.release()); 278 shared_mem_service_data_.reset(shared_mem_service_data.release());
272 return true; 279 return true;
273 } 280 }
274 281
275 IPC::ChannelHandle ServiceProcessState::GetServiceProcessChannel() { 282 IPC::ChannelHandle ServiceProcessState::GetServiceProcessChannel() {
276 return ::GetServiceProcessChannel(); 283 return ::GetServiceProcessChannel();
277 } 284 }
278 285
279 #endif // !OS_MACOSX 286 #endif // !OS_MACOSX
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698