| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 204 |
| 205 #if !defined(OS_MACOSX) && defined(OS_POSIX) && !defined(OS_ANDROID) | 205 #if !defined(OS_MACOSX) && defined(OS_POSIX) && !defined(OS_ANDROID) |
| 206 void HeadlessContentMainDelegate::ZygoteForked() { | 206 void HeadlessContentMainDelegate::ZygoteForked() { |
| 207 const base::CommandLine& command_line( | 207 const base::CommandLine& command_line( |
| 208 *base::CommandLine::ForCurrentProcess()); | 208 *base::CommandLine::ForCurrentProcess()); |
| 209 const std::string process_type = | 209 const std::string process_type = |
| 210 command_line.GetSwitchValueASCII(switches::kProcessType); | 210 command_line.GetSwitchValueASCII(switches::kProcessType); |
| 211 // Unconditionally try to turn on crash reporting since we do not have access | 211 // Unconditionally try to turn on crash reporting since we do not have access |
| 212 // to the latest browser options at this point when testing. Breakpad will | 212 // to the latest browser options at this point when testing. Breakpad will |
| 213 // bail out gracefully if the browser process hasn't enabled crash reporting. | 213 // bail out gracefully if the browser process hasn't enabled crash reporting. |
| 214 #if defined(HEADLESS_USE_BREAKPAD) |
| 214 breakpad::InitCrashReporter(process_type); | 215 breakpad::InitCrashReporter(process_type); |
| 216 #endif |
| 215 } | 217 } |
| 216 #endif | 218 #endif |
| 217 | 219 |
| 218 // static | 220 // static |
| 219 HeadlessContentMainDelegate* HeadlessContentMainDelegate::GetInstance() { | 221 HeadlessContentMainDelegate* HeadlessContentMainDelegate::GetInstance() { |
| 220 return g_current_headless_content_main_delegate; | 222 return g_current_headless_content_main_delegate; |
| 221 } | 223 } |
| 222 | 224 |
| 223 // static | 225 // static |
| 224 void HeadlessContentMainDelegate::InitializeResourceBundle() { | 226 void HeadlessContentMainDelegate::InitializeResourceBundle() { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 250 #endif | 252 #endif |
| 251 } | 253 } |
| 252 | 254 |
| 253 content::ContentBrowserClient* | 255 content::ContentBrowserClient* |
| 254 HeadlessContentMainDelegate::CreateContentBrowserClient() { | 256 HeadlessContentMainDelegate::CreateContentBrowserClient() { |
| 255 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); | 257 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); |
| 256 return browser_client_.get(); | 258 return browser_client_.get(); |
| 257 } | 259 } |
| 258 | 260 |
| 259 } // namespace headless | 261 } // namespace headless |
| OLD | NEW |