OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "headless/lib/headless_content_main_delegate.h" | 5 #include "headless/lib/headless_content_main_delegate.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 #if defined(HEADLESS_USE_BREAKPAD) | 174 #if defined(HEADLESS_USE_BREAKPAD) |
175 if (!browser_->options()->enable_crash_reporter) { | 175 if (!browser_->options()->enable_crash_reporter) { |
176 DCHECK(!breakpad::IsCrashReporterEnabled()); | 176 DCHECK(!breakpad::IsCrashReporterEnabled()); |
177 return; | 177 return; |
178 } | 178 } |
179 if (process_type != switches::kZygoteProcess) | 179 if (process_type != switches::kZygoteProcess) |
180 breakpad::InitCrashReporter(process_type); | 180 breakpad::InitCrashReporter(process_type); |
181 #elif defined(OS_MACOSX) | 181 #elif defined(OS_MACOSX) |
182 crash_reporter::InitializeCrashpad(process_type.empty(), process_type); | 182 crash_reporter::InitializeCrashpad(process_type.empty(), process_type); |
183 // Avoid adding this dependency in Windows Chrome component build, since it | 183 // Avoid adding this dependency in Windows Chrome component build, since it |
184 // chrashpad is already enabled. | 184 // chrashpad is already enabled. |
185 // TODO(dvallet): Ideally we would also want to avoid this for component build. | 185 // TODO(dvallet): Ideally we would also want to avoid this for component build. |
186 #elif defined(OS_WIN) && !defined(CHROME_MULTIPLE_DLL) | 186 #elif defined(OS_WIN) && !defined(CHROME_MULTIPLE_DLL) |
187 crash_reporter::InitializeCrashpadWithEmbeddedHandler(process_type.empty(), | 187 crash_reporter::InitializeCrashpadWithEmbeddedHandler(process_type.empty(), |
188 process_type); | 188 process_type, ""); |
189 #endif // defined(HEADLESS_USE_BREAKPAD) | 189 #endif // defined(HEADLESS_USE_BREAKPAD) |
190 } | 190 } |
191 | 191 |
192 void HeadlessContentMainDelegate::PreSandboxStartup() { | 192 void HeadlessContentMainDelegate::PreSandboxStartup() { |
193 const base::CommandLine& command_line( | 193 const base::CommandLine& command_line( |
194 *base::CommandLine::ForCurrentProcess()); | 194 *base::CommandLine::ForCurrentProcess()); |
195 #if defined(OS_WIN) | 195 #if defined(OS_WIN) |
196 // Windows always needs to initialize logging, otherwise you get a renderer | 196 // Windows always needs to initialize logging, otherwise you get a renderer |
197 // crash. | 197 // crash. |
198 InitLogging(command_line); | 198 InitLogging(command_line); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 HeadlessContentMainDelegate::CreateContentRendererClient() { | 308 HeadlessContentMainDelegate::CreateContentRendererClient() { |
309 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 309 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
310 return nullptr; | 310 return nullptr; |
311 #else | 311 #else |
312 renderer_client_ = base::MakeUnique<HeadlessContentRendererClient>(); | 312 renderer_client_ = base::MakeUnique<HeadlessContentRendererClient>(); |
313 return renderer_client_.get(); | 313 return renderer_client_.get(); |
314 #endif | 314 #endif |
315 } | 315 } |
316 | 316 |
317 } // namespace headless | 317 } // namespace headless |
OLD | NEW |