OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <windows.h> | 5 #include <windows.h> |
6 #include <malloc.h> | 6 #include <malloc.h> |
7 #include <shellscalingapi.h> | 7 #include <shellscalingapi.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <tchar.h> | 9 #include <tchar.h> |
10 | 10 |
11 #include <algorithm> | 11 #include <algorithm> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/at_exit.h" | 14 #include "base/at_exit.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/lazy_instance.h" | |
18 #include "base/logging.h" | 17 #include "base/logging.h" |
19 #include "base/path_service.h" | 18 #include "base/path_service.h" |
20 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
21 #include "base/strings/string_split.h" | 20 #include "base/strings/string_split.h" |
22 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
23 #include "base/time/time.h" | 22 #include "base/time/time.h" |
24 #include "base/win/registry.h" | 23 #include "base/win/registry.h" |
25 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
26 #include "chrome/app/main_dll_loader_win.h" | 25 #include "chrome/app/main_dll_loader_win.h" |
27 #include "chrome/browser/policy/policy_path_parser.h" | 26 #include "chrome/browser/policy/policy_path_parser.h" |
28 #include "chrome/browser/win/chrome_process_finder.h" | 27 #include "chrome/browser/win/chrome_process_finder.h" |
| 28 #include "chrome/common/chrome_constants.h" |
29 #include "chrome/common/chrome_paths_internal.h" | 29 #include "chrome/common/chrome_paths_internal.h" |
30 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
31 #include "chrome/installer/util/browser_distribution.h" | 31 #include "chrome/install_static/install_details.h" |
| 32 #include "chrome_elf/chrome_elf_constants.h" |
32 #include "chrome_elf/chrome_elf_main.h" | 33 #include "chrome_elf/chrome_elf_main.h" |
33 #include "components/crash/content/app/crash_switches.h" | 34 #include "components/crash/content/app/crash_switches.h" |
34 #include "components/crash/content/app/crashpad.h" | 35 #include "components/crash/content/app/crashpad.h" |
35 #include "components/crash/content/app/run_as_crashpad_handler_win.h" | 36 #include "components/crash/content/app/run_as_crashpad_handler_win.h" |
36 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
37 #include "content/public/common/result_codes.h" | 38 #include "content/public/common/result_codes.h" |
38 | 39 |
39 namespace { | 40 namespace { |
40 | 41 |
41 // List of switches that it's safe to rendezvous early with. Fast start should | 42 // List of switches that it's safe to rendezvous early with. Fast start should |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 198 } |
198 | 199 |
199 } // namespace | 200 } // namespace |
200 | 201 |
201 #if !defined(WIN_CONSOLE_APP) | 202 #if !defined(WIN_CONSOLE_APP) |
202 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { | 203 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { |
203 #else | 204 #else |
204 int main() { | 205 int main() { |
205 HINSTANCE instance = GetModuleHandle(nullptr); | 206 HINSTANCE instance = GetModuleHandle(nullptr); |
206 #endif | 207 #endif |
| 208 install_static::InstallDetails::ImportFromModule( |
| 209 chrome::kChromeElfDllName, kChromeElfInstallDetailsPayloadFunctionName); |
207 SignalInitializeCrashReporting(); | 210 SignalInitializeCrashReporting(); |
208 | 211 |
209 // Initialize the CommandLine singleton from the environment. | 212 // Initialize the CommandLine singleton from the environment. |
210 base::CommandLine::Init(0, nullptr); | 213 base::CommandLine::Init(0, nullptr); |
211 const base::CommandLine* command_line = | 214 const base::CommandLine* command_line = |
212 base::CommandLine::ForCurrentProcess(); | 215 base::CommandLine::ForCurrentProcess(); |
213 | 216 |
214 const std::string process_type = | 217 const std::string process_type = |
215 command_line->GetSwitchValueASCII(switches::kProcessType); | 218 command_line->GetSwitchValueASCII(switches::kProcessType); |
216 | 219 |
(...skipping 25 matching lines...) Expand all Loading... |
242 RemoveAppCompatFlagsEntry(); | 245 RemoveAppCompatFlagsEntry(); |
243 | 246 |
244 // Load and launch the chrome dll. *Everything* happens inside. | 247 // Load and launch the chrome dll. *Everything* happens inside. |
245 VLOG(1) << "About to load main DLL."; | 248 VLOG(1) << "About to load main DLL."; |
246 MainDllLoader* loader = MakeMainDllLoader(); | 249 MainDllLoader* loader = MakeMainDllLoader(); |
247 int rc = loader->Launch(instance, exe_entry_point_ticks); | 250 int rc = loader->Launch(instance, exe_entry_point_ticks); |
248 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 251 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
249 delete loader; | 252 delete loader; |
250 return rc; | 253 return rc; |
251 } | 254 } |
OLD | NEW |