Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: headless/lib/headless_content_main_delegate.cc

Issue 2836823002: Fix DCHECH errors on Windows (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/lib/browser/headless_browser_impl.cc ('k') | headless/public/headless_browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/headless_content_main_delegate.cc
diff --git a/headless/lib/headless_content_main_delegate.cc b/headless/lib/headless_content_main_delegate.cc
index 8526274a3c0bb10061e7d9eedf241a568cac7503..e5ae9ec9d7ccce0f23546d937269f1a61d6ef9ce 100644
--- a/headless/lib/headless_content_main_delegate.cc
+++ b/headless/lib/headless_content_main_delegate.cc
@@ -98,10 +98,16 @@ bool HeadlessContentMainDelegate::BasicStartupComplete(int* exit_code) {
void HeadlessContentMainDelegate::InitLogging(
const base::CommandLine& command_line) {
+ const std::string process_type =
+ command_line.GetSwitchValueASCII(switches::kProcessType);
#if !defined(OS_WIN)
if (!command_line.HasSwitch(switches::kEnableLogging))
return;
-#endif
+#else
+ // Child processes in Windows are not able to initialize logging.
+ if (!process_type.empty())
+ return;
+#endif // !defined(OS_WIN)
logging::LoggingDestination log_mode;
base::FilePath log_filename(FILE_PATH_LITERAL("chrome_debug.log"));
@@ -146,9 +152,6 @@ void HeadlessContentMainDelegate::InitLogging(
log_path = base::FilePath::FromUTF8Unsafe(filename);
}
- const std::string process_type =
- command_line.GetSwitchValueASCII(switches::kProcessType);
-
settings.logging_dest = log_mode;
settings.log_file = log_path.value().c_str();
settings.lock_log = logging::DONT_LOCK_LOG_FILE;
« no previous file with comments | « headless/lib/browser/headless_browser_impl.cc ('k') | headless/public/headless_browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698