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 "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 #include <memory> | 10 #include <memory> |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
28 #include "components/cloud_devices/common/cloud_devices_switches.h" | 28 #include "components/cloud_devices/common/cloud_devices_switches.h" |
29 #include "components/network_session_configurator/switches.h" | 29 #include "components/network_session_configurator/switches.h" |
30 #include "components/version_info/version_info.h" | 30 #include "components/version_info/version_info.h" |
31 #include "content/public/common/content_paths.h" | 31 #include "content/public/common/content_paths.h" |
32 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
33 #include "google_apis/gaia/gaia_switches.h" | 33 #include "google_apis/gaia/gaia_switches.h" |
34 #include "ui/base/ui_base_switches.h" | 34 #include "ui/base/ui_base_switches.h" |
35 | 35 |
36 #if defined(OS_WIN) | |
37 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" | |
38 #endif // defined(OS_WIN) | |
39 | |
40 #if !defined(OS_MACOSX) | 36 #if !defined(OS_MACOSX) |
41 | 37 |
42 namespace { | 38 namespace { |
43 | 39 |
44 // This should be more than enough to hold a version string assuming each part | 40 // This should be more than enough to hold a version string assuming each part |
45 // of the version string is an int64_t. | 41 // of the version string is an int64_t. |
46 const uint32_t kMaxVersionStringLength = 256; | 42 const uint32_t kMaxVersionStringLength = 256; |
47 | 43 |
48 // The structure that gets written to shared memory. | 44 // The structure that gets written to shared memory. |
49 struct ServiceProcessSharedData { | 45 struct ServiceProcessSharedData { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 std::unique_ptr<base::CommandLine> CreateServiceProcessCommandLine() { | 158 std::unique_ptr<base::CommandLine> CreateServiceProcessCommandLine() { |
163 base::FilePath exe_path; | 159 base::FilePath exe_path; |
164 PathService::Get(content::CHILD_PROCESS_EXE, &exe_path); | 160 PathService::Get(content::CHILD_PROCESS_EXE, &exe_path); |
165 DCHECK(!exe_path.empty()) << "Unable to get service process binary name."; | 161 DCHECK(!exe_path.empty()) << "Unable to get service process binary name."; |
166 std::unique_ptr<base::CommandLine> command_line( | 162 std::unique_ptr<base::CommandLine> command_line( |
167 new base::CommandLine(exe_path)); | 163 new base::CommandLine(exe_path)); |
168 command_line->AppendSwitchASCII(switches::kProcessType, | 164 command_line->AppendSwitchASCII(switches::kProcessType, |
169 switches::kServiceProcess); | 165 switches::kServiceProcess); |
170 | 166 |
171 #if defined(OS_WIN) | 167 #if defined(OS_WIN) |
172 if (startup_metric_utils::GetPreReadOptions().use_prefetch_argument) | 168 command_line->AppendArg(switches::kPrefetchArgumentOther); |
173 command_line->AppendArg(switches::kPrefetchArgumentOther); | |
174 #endif // defined(OS_WIN) | 169 #endif // defined(OS_WIN) |
175 | 170 |
176 static const char* const kSwitchesToCopy[] = { | 171 static const char* const kSwitchesToCopy[] = { |
177 switches::kCloudPrintSetupProxy, | 172 switches::kCloudPrintSetupProxy, |
178 switches::kCloudPrintURL, | 173 switches::kCloudPrintURL, |
179 switches::kCloudPrintXmppEndpoint, | 174 switches::kCloudPrintXmppEndpoint, |
180 #if defined(OS_WIN) | 175 #if defined(OS_WIN) |
181 switches::kEnableCloudPrintXps, | 176 switches::kEnableCloudPrintXps, |
182 #endif | 177 #endif |
183 switches::kEnableLogging, | 178 switches::kEnableLogging, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 shared_data->service_process_pid = base::GetCurrentProcId(); | 278 shared_data->service_process_pid = base::GetCurrentProcId(); |
284 shared_mem_service_data_.reset(shared_mem_service_data.release()); | 279 shared_mem_service_data_.reset(shared_mem_service_data.release()); |
285 return true; | 280 return true; |
286 } | 281 } |
287 | 282 |
288 IPC::ChannelHandle ServiceProcessState::GetServiceProcessChannel() { | 283 IPC::ChannelHandle ServiceProcessState::GetServiceProcessChannel() { |
289 return ::GetServiceProcessChannel(); | 284 return ::GetServiceProcessChannel(); |
290 } | 285 } |
291 | 286 |
292 #endif // !OS_MACOSX | 287 #endif // !OS_MACOSX |
OLD | NEW |