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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 15695010: Add ProfileManager::AllowGetDefaultProfile() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browsertest Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index ddf53e7fc05c760a7d142a78efacf0e7b91e2045..a806af70d3029a5be74572ed8082190a21aa40b9 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -230,9 +230,22 @@ void ProfileManager::NukeDeletedProfilesFromDisk() {
ProfilesToDelete().clear();
}
+namespace {
+
+bool s_allow_get_default_profile = false;
+
+} // namespace
+
+// static
+void ProfileManager::AllowGetDefaultProfile() {
+ s_allow_get_default_profile = true;
+}
+
// static
// TODO(nkostylev): Remove this method once all clients are migrated.
Profile* ProfileManager::GetDefaultProfile() {
+ CHECK(s_allow_get_default_profile)
+ << "GetDefaultProfile() caled befofre allowed.";
ProfileManager* profile_manager = g_browser_process->profile_manager();
return profile_manager->GetDefaultProfile(profile_manager->user_data_dir_);
}
@@ -240,6 +253,8 @@ Profile* ProfileManager::GetDefaultProfile() {
// static
// TODO(nkostylev): Remove this method once all clients are migrated.
Profile* ProfileManager::GetDefaultProfileOrOffTheRecord() {
+ CHECK(s_allow_get_default_profile)
+ << "GetDefaultProfileOrOffTheRecord() caled befofre allowed.";
// TODO (mukai,nkostylev): In the long term we should fix those cases that
// crash on Guest mode and have only one GetDefaultProfile() method.
Profile* profile = GetDefaultProfile();
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698