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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | 92 #endif |
93 | 93 |
94 #if !defined(OS_WIN) | 94 #if !defined(OS_WIN) |
95 base::CommandLine::Init(params.argc, params.argv); | 95 base::CommandLine::Init(params.argc, params.argv); |
96 #else | |
97 base::CommandLine::Init(0, NULL); | |
sky
2017/03/22 16:05:03
Why do you have to add this? Aren't we already ini
dvallet
2017/03/27 05:59:50
Done. You are right, it's not needed.
I've moved t
| |
98 #endif | |
96 const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess()); | 99 const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess()); |
97 ALLOW_UNUSED_LOCAL(command_line); | 100 ALLOW_UNUSED_LOCAL(command_line); |
98 #endif | |
99 | 101 |
100 #if defined(OS_LINUX) || defined(OS_MACOSX) | 102 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
101 if (command_line->HasSwitch(switches::kHeadless)) { | 103 if (command_line->HasSwitch(switches::kHeadless)) { |
102 #if defined(OS_MACOSX) | 104 #if defined(OS_MACOSX) |
103 SetUpBundleOverrides(); | 105 SetUpBundleOverrides(); |
104 #endif | 106 #endif |
107 #if defined(OS_WIN) | |
108 return headless::HeadlessShellMain(instance, sandbox_info); | |
109 #else | |
105 return headless::HeadlessShellMain(argc, argv); | 110 return headless::HeadlessShellMain(argc, argv); |
sky
2017/03/22 16:05:03
Can HeadlessShellMain take ContentMainParams so th
Sami
2017/03/22 19:46:25
We could add an override for that, but for users w
dvallet
2017/03/27 05:59:50
Done
| |
111 #endif | |
106 } | 112 } |
107 #endif // defined(OS_LINUX) || defined(OS_MACOSX) | 113 #endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
108 | 114 |
109 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 115 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
110 version_info::Channel channel = chrome::GetChannel(); | 116 version_info::Channel channel = chrome::GetChannel(); |
111 if (channel == version_info::Channel::CANARY || | 117 if (channel == version_info::Channel::CANARY || |
112 channel == version_info::Channel::UNKNOWN) { | 118 channel == version_info::Channel::UNKNOWN) { |
113 if (command_line->HasSwitch(switches::kMash)) | 119 if (command_line->HasSwitch(switches::kMash)) |
114 return MashMain(); | 120 return MashMain(); |
115 WaitForMashDebuggerIfNecessary(); | 121 WaitForMashDebuggerIfNecessary(); |
116 if (service_manager::ServiceManagerIsRemote()) | 122 if (service_manager::ServiceManagerIsRemote()) |
117 params.env_mode = aura::Env::Mode::MUS; | 123 params.env_mode = aura::Env::Mode::MUS; |
118 } | 124 } |
119 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 125 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
120 | 126 |
121 int rv = content::ContentMain(params); | 127 int rv = content::ContentMain(params); |
122 | 128 |
123 #if defined(OS_WIN) | 129 #if defined(OS_WIN) |
124 base::win::SetShouldCrashOnProcessDetach(false); | 130 base::win::SetShouldCrashOnProcessDetach(false); |
125 #endif | 131 #endif |
126 | 132 |
127 return rv; | 133 return rv; |
128 } | 134 } |
OLD | NEW |