Commit 447e3030 authored by Peter Kvitek's avatar Peter Kvitek Committed by Commit Bot

[headless] Normalize log path before passing it on.

Having non canonical forward slashes in log file name causes problems
with sanbox file name pattern handlign on Windows.

Bug: 859676
Change-Id: I8e00eb72db3bd7959b7e8d493fa90c5069727ec3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2518879
Commit-Queue: Peter Kvitek <kvitekp@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823895}
parent 3c4b196b
...@@ -309,6 +309,10 @@ void HeadlessContentMainDelegate::InitLogging( ...@@ -309,6 +309,10 @@ void HeadlessContentMainDelegate::InitLogging(
log_path = base::FilePath::FromUTF8Unsafe(filename); log_path = base::FilePath::FromUTF8Unsafe(filename);
} }
// On Windows, having non canonical forward slashes in log file name causes
// problems with sandbox filters, see https://crbug.com/859676
log_path = log_path.NormalizePathSeparators();
settings.logging_dest = log_mode; settings.logging_dest = log_mode;
settings.log_file_path = log_path.value().c_str(); settings.log_file_path = log_path.value().c_str();
settings.lock_log = logging::DONT_LOCK_LOG_FILE; settings.lock_log = logging::DONT_LOCK_LOG_FILE;
...@@ -318,7 +322,6 @@ void HeadlessContentMainDelegate::InitLogging( ...@@ -318,7 +322,6 @@ void HeadlessContentMainDelegate::InitLogging(
DCHECK(success); DCHECK(success);
} }
void HeadlessContentMainDelegate::InitCrashReporter( void HeadlessContentMainDelegate::InitCrashReporter(
const base::CommandLine& command_line) { const base::CommandLine& command_line) {
if (command_line.HasSwitch(::switches::kDisableBreakpad)) if (command_line.HasSwitch(::switches::kDisableBreakpad))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment