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

Side by Side Diff: chrome/common/logging_chrome.cc

Issue 23967015: Use multi-profile mount point by default after browser crash and in Guest session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ProfileManagerTest,InputMethodPersistenceTest Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_constants.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 // Need to include this before most other files because it defines 7 // Need to include this before most other files because it defines
8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define 8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define
9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the 9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the
10 // ViewMsgLog et al. functions. 10 // ViewMsgLog et al. functions.
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 base::FilePath GetSessionLogFile(const CommandLine& command_line) { 200 base::FilePath GetSessionLogFile(const CommandLine& command_line) {
201 base::FilePath log_dir; 201 base::FilePath log_dir;
202 std::string log_dir_str; 202 std::string log_dir_str;
203 scoped_ptr<base::Environment> env(base::Environment::Create()); 203 scoped_ptr<base::Environment> env(base::Environment::Create());
204 if (env->GetVar(env_vars::kSessionLogDir, &log_dir_str) && 204 if (env->GetVar(env_vars::kSessionLogDir, &log_dir_str) &&
205 !log_dir_str.empty()) { 205 !log_dir_str.empty()) {
206 log_dir = base::FilePath(log_dir_str); 206 log_dir = base::FilePath(log_dir_str);
207 } else if (command_line.HasSwitch(chromeos::switches::kLoginProfile)) { 207 } else if (command_line.HasSwitch(chromeos::switches::kLoginProfile)) {
208 PathService::Get(chrome::DIR_USER_DATA, &log_dir); 208 PathService::Get(chrome::DIR_USER_DATA, &log_dir);
209 base::FilePath profile_dir; 209 base::FilePath profile_dir;
210 if (command_line.HasSwitch(switches::kMultiProfiles)) { 210 std::string login_profile_value =
211 command_line.GetSwitchValueASCII(chromeos::switches::kLoginProfile);
212 if (login_profile_value == chrome::kLegacyProfileDir) {
213 profile_dir = base::FilePath(login_profile_value);
214 } else {
211 // We could not use g_browser_process > profile_helper() here. 215 // We could not use g_browser_process > profile_helper() here.
212 std::string profile_dir_str = chrome::kProfileDirPrefix; 216 std::string profile_dir_str = chrome::kProfileDirPrefix;
213 profile_dir_str.append( 217 profile_dir_str.append(login_profile_value);
214 command_line.GetSwitchValueASCII(chromeos::switches::kLoginProfile));
215 profile_dir = base::FilePath(profile_dir_str); 218 profile_dir = base::FilePath(profile_dir_str);
216 } else {
217 profile_dir =
218 command_line.GetSwitchValuePath(chromeos::switches::kLoginProfile);
219 } 219 }
220 log_dir = log_dir.Append(profile_dir); 220 log_dir = log_dir.Append(profile_dir);
221 } 221 }
222 return log_dir.Append(GetLogFileName().BaseName()); 222 return log_dir.Append(GetLogFileName().BaseName());
223 } 223 }
224 224
225 void RedirectChromeLogging(const CommandLine& command_line) { 225 void RedirectChromeLogging(const CommandLine& command_line) {
226 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles) && 226 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles) &&
227 chrome_logging_redirected_) { 227 chrome_logging_redirected_) {
228 // TODO(nkostylev): Support multiple active users. http://crbug.com/230345 228 // TODO(nkostylev): Support multiple active users. http://crbug.com/230345
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 time_deets.year, 455 time_deets.year,
456 time_deets.month, 456 time_deets.month,
457 time_deets.day_of_month, 457 time_deets.day_of_month,
458 time_deets.hour, 458 time_deets.hour,
459 time_deets.minute, 459 time_deets.minute,
460 time_deets.second); 460 time_deets.second);
461 return base_path.InsertBeforeExtensionASCII(suffix); 461 return base_path.InsertBeforeExtensionASCII(suffix);
462 } 462 }
463 463
464 } // namespace logging 464 } // namespace logging
OLDNEW
« no previous file with comments | « chrome/common/chrome_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698