| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/app/chrome_main_delegate.h" | 10 #include "chrome/app/chrome_main_delegate.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 CHECK(DumpProcess); | 79 CHECK(DumpProcess); |
| 80 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); | 80 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); |
| 81 | 81 |
| 82 // Verify that chrome_elf and this module (chrome.dll and chrome_child.dll) | 82 // Verify that chrome_elf and this module (chrome.dll and chrome_child.dll) |
| 83 // have the same version. | 83 // have the same version. |
| 84 if (install_static::InstallDetails::Get().VersionMismatch()) | 84 if (install_static::InstallDetails::Get().VersionMismatch()) |
| 85 base::debug::DumpWithoutCrashing(); | 85 base::debug::DumpWithoutCrashing(); |
| 86 #else | 86 #else |
| 87 params.argc = argc; | 87 params.argc = argc; |
| 88 params.argv = argv; | 88 params.argv = argv; |
| 89 #endif | |
| 90 | |
| 91 #if !defined(OS_WIN) | |
| 92 base::CommandLine::Init(params.argc, params.argv); | 89 base::CommandLine::Init(params.argc, params.argv); |
| 90 #endif // defined(OS_WIN) |
| 91 base::CommandLine::Init(0, nullptr); |
| 93 const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess()); | 92 const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess()); |
| 94 ALLOW_UNUSED_LOCAL(command_line); | 93 ALLOW_UNUSED_LOCAL(command_line); |
| 95 #endif | |
| 96 | 94 |
| 97 #if defined(OS_LINUX) || defined(OS_MACOSX) | 95 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
| 98 if (command_line->HasSwitch(switches::kHeadless)) { | 96 if (command_line->HasSwitch(switches::kHeadless)) { |
| 99 #if defined(OS_MACOSX) | 97 #if defined(OS_MACOSX) |
| 100 SetUpBundleOverrides(); | 98 SetUpBundleOverrides(); |
| 101 #endif | 99 #endif |
| 102 return headless::HeadlessShellMain(argc, argv); | 100 return headless::HeadlessShellMain(params); |
| 103 } | 101 } |
| 104 #endif // defined(OS_LINUX) || defined(OS_MACOSX) | 102 #endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
| 105 | 103 |
| 106 #if defined(OS_CHROMEOS) && BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 104 #if defined(OS_CHROMEOS) && BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 107 if (service_manager::ServiceManagerIsRemote()) | 105 if (service_manager::ServiceManagerIsRemote()) |
| 108 params.env_mode = aura::Env::Mode::MUS; | 106 params.env_mode = aura::Env::Mode::MUS; |
| 109 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 107 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 110 | 108 |
| 111 int rv = content::ContentMain(params); | 109 int rv = content::ContentMain(params); |
| 112 | 110 |
| 113 #if defined(OS_WIN) | 111 #if defined(OS_WIN) |
| 114 base::win::SetShouldCrashOnProcessDetach(false); | 112 base::win::SetShouldCrashOnProcessDetach(false); |
| 115 #endif | 113 #endif |
| 116 | 114 |
| 117 return rv; | 115 return rv; |
| 118 } | 116 } |
| OLD | NEW |