| 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();
|
|
|