| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 void HeadlessContentMainDelegate::PreSandboxStartup() { | 179 void HeadlessContentMainDelegate::PreSandboxStartup() { |
| 180 const base::CommandLine& command_line( | 180 const base::CommandLine& command_line( |
| 181 *base::CommandLine::ForCurrentProcess()); | 181 *base::CommandLine::ForCurrentProcess()); |
| 182 #if defined(OS_WIN) | 182 #if defined(OS_WIN) |
| 183 // Windows always needs to initialize logging, otherwise you get a renderer | 183 // Windows always needs to initialize logging, otherwise you get a renderer |
| 184 // crash. | 184 // crash. |
| 185 InitLogging(command_line); | 185 InitLogging(command_line); |
| 186 #else | 186 #else |
| 187 if (command_line.HasSwitch(switches::kEnableLogging)) | 187 if (command_line.HasSwitch(switches::kEnableLogging)) |
| 188 InitLogging(command_line); | 188 InitLogging(command_line); |
| 189 #endif | 189 #endif // defined(OS_WIN) |
| 190 #if !defined(OS_MACOSX) | |
| 191 InitCrashReporter(command_line); | 190 InitCrashReporter(command_line); |
| 192 #endif // defined(OS_WIN) | |
| 193 InitializeResourceBundle(); | 191 InitializeResourceBundle(); |
| 194 } | 192 } |
| 195 | 193 |
| 196 int HeadlessContentMainDelegate::RunProcess( | 194 int HeadlessContentMainDelegate::RunProcess( |
| 197 const std::string& process_type, | 195 const std::string& process_type, |
| 198 const content::MainFunctionParams& main_function_params) { | 196 const content::MainFunctionParams& main_function_params) { |
| 199 if (!process_type.empty()) | 197 if (!process_type.empty()) |
| 200 return -1; | 198 return -1; |
| 201 | 199 |
| 202 base::trace_event::TraceLog::GetInstance()->SetProcessName("HeadlessBrowser"); | 200 base::trace_event::TraceLog::GetInstance()->SetProcessName("HeadlessBrowser"); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 return browser_client_.get(); | 280 return browser_client_.get(); |
| 283 } | 281 } |
| 284 | 282 |
| 285 content::ContentRendererClient* | 283 content::ContentRendererClient* |
| 286 HeadlessContentMainDelegate::CreateContentRendererClient() { | 284 HeadlessContentMainDelegate::CreateContentRendererClient() { |
| 287 renderer_client_ = base::MakeUnique<HeadlessContentRendererClient>(); | 285 renderer_client_ = base::MakeUnique<HeadlessContentRendererClient>(); |
| 288 return renderer_client_.get(); | 286 return renderer_client_.get(); |
| 289 } | 287 } |
| 290 | 288 |
| 291 } // namespace headless | 289 } // namespace headless |
| OLD | NEW |