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

Unified Diff: chrome/browser/autofill/personal_data_manager.h

Issue 2521001: AutoFill: Make PersonalDataManager RefCountedThreadSafe. (Closed)
Patch Set: Fix lints. Created 10 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
Index: chrome/browser/autofill/personal_data_manager.h
diff --git a/chrome/browser/autofill/personal_data_manager.h b/chrome/browser/autofill/personal_data_manager.h
index 9b5ac129795aaa8de8690bb1da548029c6fbffbe..678d00101e514635ce8dc8a35f148c84cb60ae17 100644
--- a/chrome/browser/autofill/personal_data_manager.h
+++ b/chrome/browser/autofill/personal_data_manager.h
@@ -8,6 +8,7 @@
#include <set>
#include <vector>
+#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/scoped_vector.h"
#include "base/string16.h"
@@ -24,8 +25,10 @@ class Profile;
// Handles loading and saving AutoFill profile information to the web database.
// This class also stores the profiles loaded from the database for use during
// AutoFill.
-class PersonalDataManager : public WebDataServiceConsumer,
- public AutoFillDialogObserver {
+class PersonalDataManager
+ : public WebDataServiceConsumer,
+ public AutoFillDialogObserver,
+ public base::RefCountedThreadSafe<PersonalDataManager> {
public:
// An interface the PersonalDataManager uses to notify its clients (observers)
// when it has finished loading personal data from the web database. Register
@@ -39,8 +42,6 @@ class PersonalDataManager : public WebDataServiceConsumer,
virtual ~Observer() {}
};
- virtual ~PersonalDataManager();
-
// WebDataServiceConsumer implementation:
virtual void OnWebDataServiceRequestDone(WebDataService::Handle h,
const WDTypedResult* result);
@@ -153,12 +154,15 @@ class PersonalDataManager : public WebDataServiceConsumer,
void Init(Profile* profile);
protected:
- // Make sure that only Profile and the PersonalDataManager tests can create an
- // instance of PersonalDataManager.
- friend class ProfileImpl;
+ // Make sure that only Profile and certain tests can create an instance of
+ // PersonalDataManager.
+ friend class base::RefCountedThreadSafe<PersonalDataManager>;
friend class PersonalDataManagerTest;
+ friend class ProfileImpl;
+ friend class ProfileSyncServiceAutofillTest;
PersonalDataManager();
+ ~PersonalDataManager();
// Returns the profile of the tab contents.
Profile* profile();
« no previous file with comments | « chrome/browser/autofill/autofill_manager_unittest.cc ('k') | chrome/browser/autofill/personal_data_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698