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" | 17 #include "base/lazy_instance.h" |
18 #include "base/logging.h" | 18 #include "base/logging.h" |
19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
22 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
23 #include "chrome/app/chrome_crash_reporter_client.h" | 23 #include "chrome/app/chrome_crash_reporter_client.h" |
24 #include "chrome/app/main_dll_loader_win.h" | 24 #include "chrome/app/main_dll_loader_win.h" |
25 #include "chrome/browser/chrome_process_finder_win.h" | 25 #include "chrome/browser/chrome_process_finder_win.h" |
26 #include "chrome/browser/policy/policy_path_parser.h" | 26 #include "chrome/browser/policy/policy_path_parser.h" |
27 #include "chrome/common/chrome_paths_internal.h" | 27 #include "chrome/common/chrome_paths_internal.h" |
28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/installer/util/browser_distribution.h" | 29 #include "chrome/installer/util/browser_distribution.h" |
30 #include "chrome_elf/chrome_elf_main.h" | |
31 #include "components/crash/content/app/crash_reporter_client.h" | 30 #include "components/crash/content/app/crash_reporter_client.h" |
32 #include "components/crash/content/app/crash_switches.h" | 31 #include "components/crash/content/app/crash_switches.h" |
33 #include "components/crash/content/app/crashpad.h" | 32 #include "components/crash/content/app/crashpad.h" |
34 #include "components/crash/content/app/run_as_crashpad_handler_win.h" | 33 #include "components/crash/content/app/run_as_crashpad_handler_win.h" |
35 #include "components/startup_metric_utils/browser/startup_metric_utils.h" | 34 #include "components/startup_metric_utils/browser/startup_metric_utils.h" |
36 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" | 35 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" |
37 #include "content/public/common/content_switches.h" | 36 #include "content/public/common/content_switches.h" |
38 #include "content/public/common/result_codes.h" | 37 #include "content/public/common/result_codes.h" |
39 #include "ui/gfx/win/dpi.h" | 38 #include "ui/gfx/win/dpi.h" |
40 | 39 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 return crash_reporter::RunAsCrashpadHandler( | 188 return crash_reporter::RunAsCrashpadHandler( |
190 *base::CommandLine::ForCurrentProcess()); | 189 *base::CommandLine::ForCurrentProcess()); |
191 } | 190 } |
192 | 191 |
193 crash_reporter::SetCrashReporterClient(g_chrome_crash_client.Pointer()); | 192 crash_reporter::SetCrashReporterClient(g_chrome_crash_client.Pointer()); |
194 crash_reporter::InitializeCrashpadWithEmbeddedHandler(process_type.empty(), | 193 crash_reporter::InitializeCrashpadWithEmbeddedHandler(process_type.empty(), |
195 process_type); | 194 process_type); |
196 | 195 |
197 startup_metric_utils::RecordExeMainEntryPointTime(base::Time::Now()); | 196 startup_metric_utils::RecordExeMainEntryPointTime(base::Time::Now()); |
198 | 197 |
199 // Signal Chrome Elf that Chrome has begun to start. | |
200 SignalChromeElf(); | |
201 | |
202 // The exit manager is in charge of calling the dtors of singletons. | 198 // The exit manager is in charge of calling the dtors of singletons. |
203 base::AtExitManager exit_manager; | 199 base::AtExitManager exit_manager; |
204 | 200 |
205 // We don't want to set DPI awareness on pre-Win7 because we don't support | 201 // We don't want to set DPI awareness on pre-Win7 because we don't support |
206 // DirectWrite there. GDI fonts are kerned very badly, so better to leave | 202 // DirectWrite there. GDI fonts are kerned very badly, so better to leave |
207 // DPI-unaware and at effective 1.0. See also ShouldUseDirectWrite(). | 203 // DPI-unaware and at effective 1.0. See also ShouldUseDirectWrite(). |
208 if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 204 if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
209 EnableHighDPISupport(); | 205 EnableHighDPISupport(); |
210 | 206 |
211 if (AttemptFastNotify(*command_line)) | 207 if (AttemptFastNotify(*command_line)) |
212 return 0; | 208 return 0; |
213 | 209 |
214 // Load and launch the chrome dll. *Everything* happens inside. | 210 // Load and launch the chrome dll. *Everything* happens inside. |
215 VLOG(1) << "About to load main DLL."; | 211 VLOG(1) << "About to load main DLL."; |
216 MainDllLoader* loader = MakeMainDllLoader(); | 212 MainDllLoader* loader = MakeMainDllLoader(); |
217 int rc = loader->Launch(instance); | 213 int rc = loader->Launch(instance); |
218 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 214 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
219 delete loader; | 215 delete loader; |
220 return rc; | 216 return rc; |
221 } | 217 } |
OLD | NEW |