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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 CHECK(DumpProcess); | 82 CHECK(DumpProcess); |
83 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); | 83 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); |
84 | 84 |
85 // Verify that chrome_elf and this module (chrome.dll and chrome_child.dll) | 85 // Verify that chrome_elf and this module (chrome.dll and chrome_child.dll) |
86 // have the same version. | 86 // have the same version. |
87 if (install_static::InstallDetails::Get().VersionMismatch()) | 87 if (install_static::InstallDetails::Get().VersionMismatch()) |
88 base::debug::DumpWithoutCrashing(); | 88 base::debug::DumpWithoutCrashing(); |
89 #else | 89 #else |
90 params.argc = argc; | 90 params.argc = argc; |
91 params.argv = argv; | 91 params.argv = argv; |
92 #endif | |
93 | |
94 #if !defined(OS_WIN) | |
95 base::CommandLine::Init(params.argc, params.argv); | 92 base::CommandLine::Init(params.argc, params.argv); |
| 93 #endif // defined(OS_WIN) |
96 const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess()); | 94 const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess()); |
97 ALLOW_UNUSED_LOCAL(command_line); | 95 ALLOW_UNUSED_LOCAL(command_line); |
98 #endif | |
99 | 96 |
100 #if defined(OS_LINUX) || defined(OS_MACOSX) | 97 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
101 if (command_line->HasSwitch(switches::kHeadless)) { | 98 if (command_line->HasSwitch(switches::kHeadless)) { |
102 #if defined(OS_MACOSX) | 99 #if defined(OS_MACOSX) |
103 SetUpBundleOverrides(); | 100 SetUpBundleOverrides(); |
104 #endif | 101 #endif |
105 return headless::HeadlessShellMain(argc, argv); | 102 return headless::HeadlessShellMain(params); |
106 } | 103 } |
107 #endif // defined(OS_LINUX) || defined(OS_MACOSX) | 104 #endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
108 | 105 |
109 #if defined(OS_CHROMEOS) && BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 106 #if defined(OS_CHROMEOS) && BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
110 version_info::Channel channel = chrome::GetChannel(); | 107 version_info::Channel channel = chrome::GetChannel(); |
111 if (channel == version_info::Channel::CANARY || | 108 if (channel == version_info::Channel::CANARY || |
112 channel == version_info::Channel::UNKNOWN) { | 109 channel == version_info::Channel::UNKNOWN) { |
113 if (command_line->HasSwitch(switches::kMash) || | 110 if (command_line->HasSwitch(switches::kMash) || |
114 command_line->HasSwitch(switches::kMus)) { | 111 command_line->HasSwitch(switches::kMus)) { |
115 return MashMain(); | 112 return MashMain(); |
116 } | 113 } |
117 WaitForMashDebuggerIfNecessary(); | 114 WaitForMashDebuggerIfNecessary(); |
118 if (service_manager::ServiceManagerIsRemote()) | 115 if (service_manager::ServiceManagerIsRemote()) |
119 params.env_mode = aura::Env::Mode::MUS; | 116 params.env_mode = aura::Env::Mode::MUS; |
120 } | 117 } |
121 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 118 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
122 | 119 |
123 int rv = content::ContentMain(params); | 120 int rv = content::ContentMain(params); |
124 | 121 |
125 #if defined(OS_WIN) | 122 #if defined(OS_WIN) |
126 base::win::SetShouldCrashOnProcessDetach(false); | 123 base::win::SetShouldCrashOnProcessDetach(false); |
127 #endif | 124 #endif |
128 | 125 |
129 return rv; | 126 return rv; |
130 } | 127 } |
OLD | NEW |