Commit 0bc40199 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Use DIR_TEMP instead of DIR_EXE for content_shell.log

content_shell was trying to create log file in DIR_EXE. This doesn work
on platforms where the directory is not writable, particularly on
Fuchsia. Updated content_shell to use DIR_TEMP on Fuchsia.

Bug: 778467
Change-Id: I03198062e0c067340479209c99056a4e0b460ea4
Reviewed-on: https://chromium-review.googlesource.com/1054785
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558054}
parent 03c28a41
......@@ -113,13 +113,15 @@ const GUID kContentShellProviderName = {
#endif
void InitLogging(const base::CommandLine& command_line) {
base::FilePath log_filename;
std::string filename = command_line.GetSwitchValueASCII(switches::kLogFile);
if (filename.empty()) {
base::FilePath log_filename =
command_line.GetSwitchValuePath(switches::kLogFile);
if (log_filename.empty()) {
#if defined(OS_FUCHSIA)
base::PathService::Get(base::DIR_TEMP, &log_filename);
#else
base::PathService::Get(base::DIR_EXE, &log_filename);
#endif
log_filename = log_filename.AppendASCII("content_shell.log");
} else {
log_filename = base::FilePath::FromUTF8Unsafe(filename);
}
logging::LoggingSettings settings;
......
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