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

Side by Side Diff: chrome/browser/profile_manager.cc

Issue 2866034: Refactor shutdown code to allow win/linux to run after last browser closes. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Uploaded patch that resolves merge issue Created 10 years, 5 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
« no previous file with comments | « chrome/browser/js_modal_dialog.cc ('k') | chrome/browser/tab_contents/background_contents.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <set> 5 #include <set>
6 6
7 #include "chrome/browser/profile_manager.h" 7 #include "chrome/browser/profile_manager.h"
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 21 matching lines...) Expand all
32 #include "net/url_request/url_request_job_tracker.h" 32 #include "net/url_request/url_request_job_tracker.h"
33 33
34 #if defined(OS_CHROMEOS) 34 #if defined(OS_CHROMEOS)
35 #include "chrome/browser/chromeos/cros/cros_library.h" 35 #include "chrome/browser/chromeos/cros/cros_library.h"
36 #include "chrome/browser/chromeos/cros/cryptohome_library.h" 36 #include "chrome/browser/chromeos/cros/cryptohome_library.h"
37 #endif 37 #endif
38 38
39 // static 39 // static
40 void ProfileManager::ShutdownSessionServices() { 40 void ProfileManager::ShutdownSessionServices() {
41 ProfileManager* pm = g_browser_process->profile_manager(); 41 ProfileManager* pm = g_browser_process->profile_manager();
42 if (!pm) // Is NULL when running unit tests.
43 return;
42 for (ProfileManager::const_iterator i = pm->begin(); i != pm->end(); ++i) 44 for (ProfileManager::const_iterator i = pm->begin(); i != pm->end(); ++i)
43 (*i)->ShutdownSessionService(); 45 (*i)->ShutdownSessionService();
44 } 46 }
45 47
46 // static 48 // static
47 Profile* ProfileManager::GetDefaultProfile() { 49 Profile* ProfileManager::GetDefaultProfile() {
48 FilePath user_data_dir; 50 FilePath user_data_dir;
49 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); 51 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
50 ProfileManager* profile_manager = g_browser_process->profile_manager(); 52 ProfileManager* profile_manager = g_browser_process->profile_manager();
51 return profile_manager->GetDefaultProfile(user_data_dir); 53 return profile_manager->GetDefaultProfile(user_data_dir);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 if (!file_util::PathExists(path)) { 286 if (!file_util::PathExists(path)) {
285 // TODO(tc): http://b/1094718 Bad things happen if we can't write to the 287 // TODO(tc): http://b/1094718 Bad things happen if we can't write to the
286 // profile directory. We should eventually be able to run in this 288 // profile directory. We should eventually be able to run in this
287 // situation. 289 // situation.
288 if (!file_util::CreateDirectory(path)) 290 if (!file_util::CreateDirectory(path))
289 return NULL; 291 return NULL;
290 } 292 }
291 293
292 return Profile::CreateProfile(path); 294 return Profile::CreateProfile(path);
293 } 295 }
OLDNEW
« no previous file with comments | « chrome/browser/js_modal_dialog.cc ('k') | chrome/browser/tab_contents/background_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698