From 36c1ff9fd1b301c7b2de0f364e9ba10835d3a9c6 Mon Sep 17 00:00:00 2001 From: "jhawkins@chromium.org" Date: Thu, 3 Jun 2010 20:08:59 +0000 Subject: 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 --- chrome/browser/autofill/personal_data_manager.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to '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 9b5ac12..678d001 100644 --- a/chrome/browser/autofill/personal_data_manager.h +++ b/chrome/browser/autofill/personal_data_manager.h @@ -8,6 +8,7 @@ #include #include +#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 { 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; friend class PersonalDataManagerTest; + friend class ProfileImpl; + friend class ProfileSyncServiceAutofillTest; PersonalDataManager(); + ~PersonalDataManager(); // Returns the profile of the tab contents. Profile* profile(); -- cgit v1.1