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

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

Issue 1869473002: Fixed crash on double profile delete operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
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 "chrome/browser/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 719
720 ProfileAttributesStorage& ProfileManager::GetProfileAttributesStorage() { 720 ProfileAttributesStorage& ProfileManager::GetProfileAttributesStorage() {
721 return GetProfileInfoCache(); 721 return GetProfileInfoCache();
722 } 722 }
723 723
724 ProfileShortcutManager* ProfileManager::profile_shortcut_manager() { 724 ProfileShortcutManager* ProfileManager::profile_shortcut_manager() {
725 return profile_shortcut_manager_.get(); 725 return profile_shortcut_manager_.get();
726 } 726 }
727 727
728 #if !defined(OS_ANDROID) 728 #if !defined(OS_ANDROID)
729 bool ProfileManager::MaybeScheduleProfileForDeletion(
730 const base::FilePath& profile_dir,
731 const CreateCallback& callback) {
732 if (IsProfileMarkedForDeletion(profile_dir))
733 return false;
734 ScheduleProfileForDeletion(profile_dir, callback);
735 return true;
736 }
737
729 void ProfileManager::ScheduleProfileForDeletion( 738 void ProfileManager::ScheduleProfileForDeletion(
730 const base::FilePath& profile_dir, 739 const base::FilePath& profile_dir,
731 const CreateCallback& callback) { 740 const CreateCallback& callback) {
732 DCHECK(profiles::IsMultipleProfilesEnabled()); 741 DCHECK(profiles::IsMultipleProfilesEnabled());
stevenjb 2016/05/12 15:52:59 We should probably add CHECK(!IsProfileMarkedForDe
733 742
734 // Cancel all in-progress downloads before deleting the profile to prevent a 743 // Cancel all in-progress downloads before deleting the profile to prevent a
735 // "Do you want to exit Google Chrome and cancel the downloads?" prompt 744 // "Do you want to exit Google Chrome and cancel the downloads?" prompt
736 // (crbug.com/336725). 745 // (crbug.com/336725).
737 Profile* profile = GetProfileByPath(profile_dir); 746 Profile* profile = GetProfileByPath(profile_dir);
738 if (profile) { 747 if (profile) {
739 DownloadService* service = 748 DownloadService* service =
740 DownloadServiceFactory::GetForBrowserContext(profile); 749 DownloadServiceFactory::GetForBrowserContext(profile);
741 service->CancelDownloads(); 750 service->CancelDownloads();
742 } 751 }
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 1633
1625 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); 1634 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path);
1626 if (!original_callback.is_null()) 1635 if (!original_callback.is_null())
1627 original_callback.Run(loaded_profile, status); 1636 original_callback.Run(loaded_profile, status);
1628 } 1637 }
1629 #endif // !defined(OS_ANDROID) 1638 #endif // !defined(OS_ANDROID)
1630 1639
1631 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1640 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1632 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1641 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1633 } 1642 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698