diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-03 20:08:59 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-03 20:08:59 +0000 |
commit | 36c1ff9fd1b301c7b2de0f364e9ba10835d3a9c6 (patch) | |
tree | 1db4b79cff59183ba947a7994522efaaab619c21 /chrome/browser/autofill/personal_data_manager.h | |
parent | ad3c0f1de336eef69795f1228101cd0486ec0a4c (diff) | |
download | chromium_src-36c1ff9fd1b301c7b2de0f364e9ba10835d3a9c6.zip chromium_src-36c1ff9fd1b301c7b2de0f364e9ba10835d3a9c6.tar.gz chromium_src-36c1ff9fd1b301c7b2de0f364e9ba10835d3a9c6.tar.bz2 |
AutoFill: Make PersonalDataManager RefCountedThreadSafe.
BUG=40617
TEST=none
Review URL: http://codereview.chromium.org/2521001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/personal_data_manager.h')
-rw-r--r-- | chrome/browser/autofill/personal_data_manager.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/chrome/browser/autofill/personal_data_manager.h b/chrome/browser/autofill/personal_data_manager.h index 9b5ac12..678d001 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(); |