| 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 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 install_static::GetExecutableVersionDetails(exe_file, &product_name, &version, | 211 install_static::GetExecutableVersionDetails(exe_file, &product_name, &version, |
| 212 &special_build, &channel_name); | 212 &special_build, &channel_name); |
| 213 | 213 |
| 214 return crash_reporter::RunAsFallbackCrashHandler( | 214 return crash_reporter::RunAsFallbackCrashHandler( |
| 215 cmd_line, base::UTF16ToUTF8(product_name), base::UTF16ToUTF8(version), | 215 cmd_line, base::UTF16ToUTF8(product_name), base::UTF16ToUTF8(version), |
| 216 base::UTF16ToUTF8(channel_name)); | 216 base::UTF16ToUTF8(channel_name)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace | 219 } // namespace |
| 220 | 220 |
| 221 #if defined(SYZYASAN) | |
| 222 // This is in chrome_elf. | |
| 223 extern "C" void BlockUntilHandlerStartedImpl(); | |
| 224 #endif // SYZYASAN | |
| 225 | |
| 226 #if !defined(WIN_CONSOLE_APP) | 221 #if !defined(WIN_CONSOLE_APP) |
| 227 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { | 222 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { |
| 228 #else | 223 #else |
| 229 int main() { | 224 int main() { |
| 230 HINSTANCE instance = GetModuleHandle(nullptr); | 225 HINSTANCE instance = GetModuleHandle(nullptr); |
| 231 #endif | 226 #endif |
| 232 install_static::InitializeFromPrimaryModule(); | 227 install_static::InitializeFromPrimaryModule(); |
| 233 SignalInitializeCrashReporting(); | 228 SignalInitializeCrashReporting(); |
| 234 | 229 |
| 235 // Initialize the CommandLine singleton from the environment. | 230 // Initialize the CommandLine singleton from the environment. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 253 *base::CommandLine::ForCurrentProcess()); | 248 *base::CommandLine::ForCurrentProcess()); |
| 254 } else if (process_type == crash_reporter::switches::kFallbackCrashHandler) { | 249 } else if (process_type == crash_reporter::switches::kFallbackCrashHandler) { |
| 255 return RunFallbackCrashHandler(*command_line); | 250 return RunFallbackCrashHandler(*command_line); |
| 256 } | 251 } |
| 257 | 252 |
| 258 const base::TimeTicks exe_entry_point_ticks = base::TimeTicks::Now(); | 253 const base::TimeTicks exe_entry_point_ticks = base::TimeTicks::Now(); |
| 259 | 254 |
| 260 // Signal Chrome Elf that Chrome has begun to start. | 255 // Signal Chrome Elf that Chrome has begun to start. |
| 261 SignalChromeElf(); | 256 SignalChromeElf(); |
| 262 | 257 |
| 263 #if defined(SYZYASAN) | |
| 264 if (process_type.empty()) { | |
| 265 // This is a temporary workaround for a race during startup with the | |
| 266 // syzyasan_rtl.dll. See https://crbug.com/675710. | |
| 267 BlockUntilHandlerStartedImpl(); | |
| 268 } | |
| 269 #endif // SYZYASAN | |
| 270 | |
| 271 // The exit manager is in charge of calling the dtors of singletons. | 258 // The exit manager is in charge of calling the dtors of singletons. |
| 272 base::AtExitManager exit_manager; | 259 base::AtExitManager exit_manager; |
| 273 | 260 |
| 274 EnableHighDPISupport(); | 261 EnableHighDPISupport(); |
| 275 | 262 |
| 276 if (AttemptFastNotify(*command_line)) | 263 if (AttemptFastNotify(*command_line)) |
| 277 return 0; | 264 return 0; |
| 278 | 265 |
| 279 RemoveAppCompatFlagsEntry(); | 266 RemoveAppCompatFlagsEntry(); |
| 280 | 267 |
| 281 // Load and launch the chrome dll. *Everything* happens inside. | 268 // Load and launch the chrome dll. *Everything* happens inside. |
| 282 VLOG(1) << "About to load main DLL."; | 269 VLOG(1) << "About to load main DLL."; |
| 283 MainDllLoader* loader = MakeMainDllLoader(); | 270 MainDllLoader* loader = MakeMainDllLoader(); |
| 284 int rc = loader->Launch(instance, exe_entry_point_ticks); | 271 int rc = loader->Launch(instance, exe_entry_point_ticks); |
| 285 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 272 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
| 286 delete loader; | 273 delete loader; |
| 287 return rc; | 274 return rc; |
| 288 } | 275 } |
| OLD | NEW |