| 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 <tchar.h> | 6 #include <tchar.h> |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 HWND chrome = chrome::FindRunningChromeWindow(user_data_dir); | 73 HWND chrome = chrome::FindRunningChromeWindow(user_data_dir); |
| 74 if (!chrome) | 74 if (!chrome) |
| 75 return false; | 75 return false; |
| 76 return chrome::AttemptToNotifyRunningChrome(chrome, true) == | 76 return chrome::AttemptToNotifyRunningChrome(chrome, true) == |
| 77 chrome::NOTIFY_SUCCESS; | 77 chrome::NOTIFY_SUCCESS; |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace | 80 } // namespace |
| 81 | 81 |
| 82 #if !defined(ADDRESS_SANITIZER) | 82 #if !defined(FORCE_CONSOLE_SUBSYSTEM) |
| 83 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { | 83 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { |
| 84 #else | 84 #else |
| 85 // The AddressSanitizer build should be a console program as it prints out stuff | |
| 86 // on stderr. | |
| 87 int main() { | 85 int main() { |
| 88 HINSTANCE instance = GetModuleHandle(NULL); | 86 HINSTANCE instance = GetModuleHandle(NULL); |
| 89 #endif | 87 #endif |
| 90 startup_metric_utils::RecordExeMainEntryTime(); | 88 startup_metric_utils::RecordExeMainEntryTime(); |
| 91 | 89 |
| 92 // Signal Chrome Elf that Chrome has begun to start. | 90 // Signal Chrome Elf that Chrome has begun to start. |
| 93 SignalChromeElf(); | 91 SignalChromeElf(); |
| 94 | 92 |
| 95 // Initialize the commandline singleton from the environment. | 93 // Initialize the commandline singleton from the environment. |
| 96 CommandLine::Init(0, NULL); | 94 CommandLine::Init(0, NULL); |
| 97 // The exit manager is in charge of calling the dtors of singletons. | 95 // The exit manager is in charge of calling the dtors of singletons. |
| 98 base::AtExitManager exit_manager; | 96 base::AtExitManager exit_manager; |
| 99 | 97 |
| 100 gfx::EnableHighDPISupport(); | 98 gfx::EnableHighDPISupport(); |
| 101 | 99 |
| 102 if (AttemptFastNotify(*CommandLine::ForCurrentProcess())) | 100 if (AttemptFastNotify(*CommandLine::ForCurrentProcess())) |
| 103 return 0; | 101 return 0; |
| 104 | 102 |
| 105 CheckSafeModeLaunch(); | 103 CheckSafeModeLaunch(); |
| 106 | 104 |
| 107 // Load and launch the chrome dll. *Everything* happens inside. | 105 // Load and launch the chrome dll. *Everything* happens inside. |
| 108 MainDllLoader* loader = MakeMainDllLoader(); | 106 MainDllLoader* loader = MakeMainDllLoader(); |
| 109 int rc = loader->Launch(instance); | 107 int rc = loader->Launch(instance); |
| 110 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 108 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
| 111 delete loader; | 109 delete loader; |
| 112 return rc; | 110 return rc; |
| 113 } | 111 } |
| OLD | NEW |