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 "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 | 195 |
196 void HeadlessContentMainDelegate::ZygoteForked() { | 196 void HeadlessContentMainDelegate::ZygoteForked() { |
197 const base::CommandLine& command_line( | 197 const base::CommandLine& command_line( |
198 *base::CommandLine::ForCurrentProcess()); | 198 *base::CommandLine::ForCurrentProcess()); |
199 const std::string process_type = | 199 const std::string process_type = |
200 command_line.GetSwitchValueASCII(switches::kProcessType); | 200 command_line.GetSwitchValueASCII(switches::kProcessType); |
201 // Unconditionally try to turn on crash reporting since we do not have access | 201 // Unconditionally try to turn on crash reporting since we do not have access |
202 // to the latest browser options at this point when testing. Breakpad will | 202 // to the latest browser options at this point when testing. Breakpad will |
203 // bail out gracefully if the browser process hasn't enabled crash reporting. | 203 // bail out gracefully if the browser process hasn't enabled crash reporting. |
| 204 #if defined(HEADLESS_USE_BREAKPAD) |
204 breakpad::InitCrashReporter(process_type); | 205 breakpad::InitCrashReporter(process_type); |
| 206 #endif |
205 } | 207 } |
206 | 208 |
207 // static | 209 // static |
208 HeadlessContentMainDelegate* HeadlessContentMainDelegate::GetInstance() { | 210 HeadlessContentMainDelegate* HeadlessContentMainDelegate::GetInstance() { |
209 return g_current_headless_content_main_delegate; | 211 return g_current_headless_content_main_delegate; |
210 } | 212 } |
211 | 213 |
212 // static | 214 // static |
213 void HeadlessContentMainDelegate::InitializeResourceBundle() { | 215 void HeadlessContentMainDelegate::InitializeResourceBundle() { |
214 base::FilePath dir_module; | 216 base::FilePath dir_module; |
(...skipping 24 matching lines...) Expand all Loading... |
239 #endif | 241 #endif |
240 } | 242 } |
241 | 243 |
242 content::ContentBrowserClient* | 244 content::ContentBrowserClient* |
243 HeadlessContentMainDelegate::CreateContentBrowserClient() { | 245 HeadlessContentMainDelegate::CreateContentBrowserClient() { |
244 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); | 246 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); |
245 return browser_client_.get(); | 247 return browser_client_.get(); |
246 } | 248 } |
247 | 249 |
248 } // namespace headless | 250 } // namespace headless |
OLD | NEW |