diff options
author | gspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 20:16:20 +0000 |
---|---|---|
committer | gspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 20:16:20 +0000 |
commit | 986c378d6312bd56c3da012e8f9db45c176e2118 (patch) | |
tree | 8b9c236799bfc4963f7dff7a5ae758c23825b3d1 /chrome/common | |
parent | b86c39eb7c7fe2573768d907ab7d03f265c51904 (diff) | |
download | chromium_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')
-rw-r--r-- | chrome/common/env_vars.cc | 3 | ||||
-rw-r--r-- | chrome/common/env_vars.h | 1 | ||||
-rw-r--r-- | chrome/common/logging_chrome.cc | 32 | ||||
-rw-r--r-- | chrome/common/logging_chrome.h | 4 |
4 files changed, 6 insertions, 34 deletions
diff --git a/chrome/common/env_vars.cc b/chrome/common/env_vars.cc index f63d3e4..dc2648c 100644 --- a/chrome/common/env_vars.cc +++ b/chrome/common/env_vars.cc @@ -14,9 +14,6 @@ const char kHeadless[] = "CHROME_HEADLESS"; // The name of the log file. const char kLogFileName[] = "CHROME_LOG_FILE"; -// The name of the session log directory when logged in to ChromeOS. -const char kSessionLogDir[] = "CHROMEOS_SESSION_LOG_DIR"; - // If this environment variable is set, Chrome on Windows will log // to Event Tracing for Windows. const char kEtwLogging[] = "CHROME_ETW_LOGGING"; diff --git a/chrome/common/env_vars.h b/chrome/common/env_vars.h index 320a0b4..e9984d2a 100644 --- a/chrome/common/env_vars.h +++ b/chrome/common/env_vars.h @@ -12,7 +12,6 @@ namespace env_vars { extern const char kHeadless[]; extern const char kLogFileName[]; -extern const char kSessionLogDir[]; extern const char kEtwLogging[]; extern const char kShowRestart[]; extern const char kRestartInfo[]; 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. diff --git a/chrome/common/logging_chrome.h b/chrome/common/logging_chrome.h index 2812721..c8dac42 100644 --- a/chrome/common/logging_chrome.h +++ b/chrome/common/logging_chrome.h @@ -37,8 +37,8 @@ void InitChromeLogging(const CommandLine& command_line, OldFileDeletionState delete_old_log_file); #if defined(OS_CHROMEOS) -// Redirects chrome logging to the appropriate session log dir. -void RedirectChromeLogging(const CommandLine& command_line); +void RedirectChromeLogging(const FilePath& new_log_dir, + const CommandLine& command_line); #endif // Call when done using logging for Chrome. |