| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } else { | 70 } else { |
| 71 command_line->AppendSwitch(switches::kDisableGpu); | 71 command_line->AppendSwitch(switches::kDisableGpu); |
| 72 } | 72 } |
| 73 | 73 |
| 74 SetContentClient(&content_client_); | 74 SetContentClient(&content_client_); |
| 75 return false; | 75 return false; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void HeadlessContentMainDelegate::InitLogging( | 78 void HeadlessContentMainDelegate::InitLogging( |
| 79 const base::CommandLine& command_line) { | 79 const base::CommandLine& command_line) { |
| 80 #if !defined(OS_WIN) |
| 80 if (!command_line.HasSwitch(switches::kEnableLogging)) | 81 if (!command_line.HasSwitch(switches::kEnableLogging)) |
| 81 return; | 82 return; |
| 83 #endif |
| 82 | 84 |
| 83 logging::LoggingDestination log_mode; | 85 logging::LoggingDestination log_mode; |
| 84 base::FilePath log_filename(FILE_PATH_LITERAL("chrome_debug.log")); | 86 base::FilePath log_filename(FILE_PATH_LITERAL("chrome_debug.log")); |
| 85 if (command_line.GetSwitchValueASCII(switches::kEnableLogging) == "stderr") { | 87 if (command_line.GetSwitchValueASCII(switches::kEnableLogging) == "stderr") { |
| 86 log_mode = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 88 log_mode = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
| 87 } else { | 89 } else { |
| 88 base::FilePath custom_filename( | 90 base::FilePath custom_filename( |
| 89 command_line.GetSwitchValuePath(switches::kEnableLogging)); | 91 command_line.GetSwitchValuePath(switches::kEnableLogging)); |
| 90 if (custom_filename.empty()) { | 92 if (custom_filename.empty()) { |
| 91 log_mode = logging::LOG_TO_ALL; | 93 log_mode = logging::LOG_TO_ALL; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 #endif | 201 #endif |
| 200 } | 202 } |
| 201 | 203 |
| 202 content::ContentBrowserClient* | 204 content::ContentBrowserClient* |
| 203 HeadlessContentMainDelegate::CreateContentBrowserClient() { | 205 HeadlessContentMainDelegate::CreateContentBrowserClient() { |
| 204 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); | 206 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); |
| 205 return browser_client_.get(); | 207 return browser_client_.get(); |
| 206 } | 208 } |
| 207 | 209 |
| 208 } // namespace headless | 210 } // namespace headless |
| OLD | NEW |