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

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

Issue 1869473002: Fixed crash on double profile delete operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review fixes. 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 // This class keeps track of the currently-active profiles in the runtime. 5 // This class keeps track of the currently-active profiles in the runtime.
6 6
7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_
8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ 8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_
9 9
10 #include <stddef.h> 10 #include <stddef.h>
11 11
12 #include <list> 12 #include <list>
13 #include <memory> 13 #include <memory>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/containers/hash_tables.h" 16 #include "base/containers/hash_tables.h"
17 #include "base/files/file_path.h" 17 #include "base/files/file_path.h"
18 #include "base/gtest_prod_util.h" 18 #include "base/gtest_prod_util.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "base/memory/linked_ptr.h" 20 #include "base/memory/linked_ptr.h"
21 #include "base/message_loop/message_loop.h" 21 #include "base/message_loop/message_loop.h"
22 #include "base/threading/non_thread_safe.h" 22 #include "base/threading/non_thread_safe.h"
23 #include "build/build_config.h" 23 #include "build/build_config.h"
24 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/profiles/profile_metrics.h"
25 #include "chrome/browser/profiles/profile_shortcut_manager.h" 26 #include "chrome/browser/profiles/profile_shortcut_manager.h"
26 #include "chrome/browser/ui/browser_list_observer.h" 27 #include "chrome/browser/ui/browser_list_observer.h"
27 #include "content/public/browser/notification_observer.h" 28 #include "content/public/browser/notification_observer.h"
28 #include "content/public/browser/notification_registrar.h" 29 #include "content/public/browser/notification_registrar.h"
29 30
30 class NewProfileLauncher; 31 class NewProfileLauncher;
31 class ProfileAttributesStorage; 32 class ProfileAttributesStorage;
32 class ProfileInfoCache; 33 class ProfileInfoCache;
33 34
34 class ProfileManager : public base::NonThreadSafe, 35 class ProfileManager : public base::NonThreadSafe,
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 183
183 // Returns a ProfileAttributesStorage object which can be used to get 184 // Returns a ProfileAttributesStorage object which can be used to get
184 // information about profiles without having to load them from disk. 185 // information about profiles without having to load them from disk.
185 ProfileAttributesStorage& GetProfileAttributesStorage(); 186 ProfileAttributesStorage& GetProfileAttributesStorage();
186 187
187 // Returns a ProfileShortcut Manager that enables the caller to create 188 // Returns a ProfileShortcut Manager that enables the caller to create
188 // profile specfic desktop shortcuts. 189 // profile specfic desktop shortcuts.
189 ProfileShortcutManager* profile_shortcut_manager(); 190 ProfileShortcutManager* profile_shortcut_manager();
190 191
191 #if !defined(OS_ANDROID) 192 #if !defined(OS_ANDROID)
193 // Less strict version of ScheduleProfileForDeletion(), silently fail if
194 // profile already marked for deletion. Returns true if the profile scheduled
195 // for deletion.
196 bool MaybeScheduleProfileForDeletion(const base::FilePath& profile_dir,
197 const CreateCallback& callback,
198 ProfileMetrics::ProfileDelete user);
199
192 // Schedules the profile at the given path to be deleted on shutdown. If we're 200 // Schedules the profile at the given path to be deleted on shutdown. If we're
193 // deleting the last profile, a new one will be created in its place, and in 201 // deleting the last profile, a new one will be created in its place, and in
194 // that case the callback will be called when profile creation is complete. 202 // that case the callback will be called when profile creation is complete.
195 void ScheduleProfileForDeletion(const base::FilePath& profile_dir, 203 void ScheduleProfileForDeletion(const base::FilePath& profile_dir,
196 const CreateCallback& callback); 204 const CreateCallback& callback);
197 #endif 205 #endif
198 206
199 // Autoloads profiles if they are running background apps. 207 // Autoloads profiles if they are running background apps.
200 void AutoloadProfiles(); 208 void AutoloadProfiles();
201 209
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 class ProfileManagerWithoutInit : public ProfileManager { 412 class ProfileManagerWithoutInit : public ProfileManager {
405 public: 413 public:
406 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); 414 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir);
407 415
408 protected: 416 protected:
409 void DoFinalInitForServices(Profile*, bool) override {} 417 void DoFinalInitForServices(Profile*, bool) override {}
410 void DoFinalInitLogging(Profile*) override {} 418 void DoFinalInitLogging(Profile*) override {}
411 }; 419 };
412 420
413 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ 421 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | chrome/browser/ui/webui/profile_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698