summaryrefslogtreecommitdiffstats
path: root/chrome/common/logging_chrome.cc
diff options
context:
space:
mode:
authorgspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 20:16:20 +0000
committergspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 20:16:20 +0000
commit986c378d6312bd56c3da012e8f9db45c176e2118 (patch)
tree8b9c236799bfc4963f7dff7a5ae758c23825b3d1 /chrome/common/logging_chrome.cc
parentb86c39eb7c7fe2573768d907ab7d03f265c51904 (diff)
downloadchromium_src-986c378d6312bd56c3da012e8f9db45c176e2118.zip
chromium_src-986c378d6312bd56c3da012e8f9db45c176e2118.tar.gz
chromium_src-986c378d6312bd56c3da012e8f9db45c176e2118.tar.bz2
Revert 64638 - This moves log output for ChromeOS to safer locations.
For BWSI (incognito) mode, we want to make sure that we don't leak private information between sessions, so we need to have chrome write log output to the tmpfs created for that mode. Also, the chrome log in "logged in" mode should reside in the "log" subdir instead of in the user data dir. BUG=http://crosbug.com/6908 TEST=Ran on device in incognito and regular modes, and watched where log output ended up. Review URL: http://codereview.chromium.org/4194005 TBR=gspencer@chromium.org Review URL: http://codereview.chromium.org/4089014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/logging_chrome.cc')
-rw-r--r--chrome/common/logging_chrome.cc32
1 files changed, 4 insertions, 28 deletions
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc
index 0b2a620..6106e43 100644
--- a/chrome/common/logging_chrome.cc
+++ b/chrome/common/logging_chrome.cc
@@ -150,23 +150,6 @@ FilePath GenerateTimestampedName(const FilePath& base_path,
return base_path.InsertBeforeExtension(suffix);
}
-FilePath GetSessionLogFile(const CommandLine& command_line) {
- FilePath log_dir;
- std::string log_dir_str;
- scoped_ptr<base::Environment> env(base::Environment::Create());
- if (env->GetVar(env_vars::kSessionLogDir, &log_dir_str) &&
- !log_dir_str.empty()) {
- log_dir = FilePath(log_dir_str);
- } else {
- PathService::Get(chrome::DIR_USER_DATA, &log_dir);
- FilePath login_profile =
- command_line.GetSwitchValuePath(switches::kLoginProfile);
- log_dir = log_dir.Append(login_profile);
- }
- DCHECK(file_util::PathExists(log_dir));
- return log_dir.Append(GetLogFileName().BaseName());
-}
-
FilePath SetUpSymlinkIfNeeded(const FilePath& symlink_path, bool new_log) {
DCHECK(!symlink_path.empty());
@@ -210,13 +193,12 @@ void RemoveSymlinkAndLog(const FilePath& link_path,
} // anonymous namespace
-void RedirectChromeLogging(const CommandLine& command_line) {
+void RedirectChromeLogging(const FilePath& new_log_dir,
+ const CommandLine& command_line) {
DCHECK(!chrome_logging_redirected_) <<
"Attempted to redirect logging when it was already initialized.";
-
- // Redirect logs to the session log directory, if set. Otherwise
- // defaults to the profile dir.
- FilePath log_path = GetSessionLogFile(command_line);
+ FilePath orig_log_path = GetLogFileName();
+ FilePath log_path = new_log_dir.Append(orig_log_path.BaseName());
// Always force a new symlink when redirecting.
FilePath target_path = SetUpSymlinkIfNeeded(log_path, true);
@@ -247,12 +229,6 @@ void InitChromeLogging(const CommandLine& command_line,
FilePath log_path = GetLogFileName();
#if defined(OS_CHROMEOS)
- // For BWSI (Incognito) logins, we want to put the logs in the user
- // profile directory that is created for the temporary session instead
- // of in the system log directory, for privacy reasons.
- if (command_line.HasSwitch(switches::kGuestSession))
- log_path = GetSessionLogFile(command_line);
-
// On ChromeOS we log to the symlink. We force creation of a new
// symlink if we've been asked to delete the old log, since that
// indicates the start of a new session.