diff options
author | caitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 05:43:56 +0000 |
---|---|---|
committer | caitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 05:43:56 +0000 |
commit | 408bbf8df1468d47a0e9d6a46ac0493ce1253f73 (patch) | |
tree | c75c45ade0872bb0aa478604d3ed0d645a2734ca /components/webdata/common | |
parent | f4647693006cf1a5cd70aa7058fe7dde14610e57 (diff) | |
download | chromium_src-408bbf8df1468d47a0e9d6a46ac0493ce1253f73.zip chromium_src-408bbf8df1468d47a0e9d6a46ac0493ce1253f73.tar.gz chromium_src-408bbf8df1468d47a0e9d6a46ac0493ce1253f73.tar.bz2 |
Un-refcount AutofillWebData and TokenWebData
depends on https://codereview.chromium.org/15927029/
BUG=230920
Review URL: https://chromiumcodereview.appspot.com/16154031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205038 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/webdata/common')
-rw-r--r-- | components/webdata/common/web_data_service_base.h | 17 | ||||
-rw-r--r-- | components/webdata/common/web_data_service_test_util.cc | 12 | ||||
-rw-r--r-- | components/webdata/common/web_data_service_test_util.h | 13 |
3 files changed, 17 insertions, 25 deletions
diff --git a/components/webdata/common/web_data_service_base.h b/components/webdata/common/web_data_service_base.h index 11d5d3e..0510184 100644 --- a/components/webdata/common/web_data_service_base.h +++ b/components/webdata/common/web_data_service_base.h @@ -23,9 +23,7 @@ class Thread; } // Base for WebDataService class hierarchy. -class WEBDATA_EXPORT WebDataServiceBase - : public base::RefCountedThreadSafe<WebDataServiceBase, - content::BrowserThread::DeleteOnUIThread> { +class WEBDATA_EXPORT WebDataServiceBase { public: // All requests return an opaque handle of the following type. typedef int Handle; @@ -48,6 +46,8 @@ class WEBDATA_EXPORT WebDataServiceBase WebDataServiceBase(scoped_refptr<WebDatabaseService> wdbs, const ProfileErrorCallback& callback); + virtual ~WebDataServiceBase(); + // Cancel any pending request. You need to call this method if your // WebDataServiceConsumer is about to be deleted. virtual void CancelRequest(Handle h); @@ -88,20 +88,13 @@ class WEBDATA_EXPORT WebDataServiceBase virtual WebDatabase* GetDatabase(); protected: - virtual ~WebDataServiceBase(); - // Our database service. scoped_refptr<WebDatabaseService> wdbs_; private: - friend struct content::BrowserThread::DeleteOnThread< - content::BrowserThread::UI>; - friend class base::DeleteHelper<WebDataServiceBase>; - // We have to friend RCTS<> so WIN shared-lib build is happy (crbug/112250). - friend class base::RefCountedThreadSafe<WebDataServiceBase, - content::BrowserThread::DeleteOnUIThread>; - ProfileErrorCallback profile_error_callback_; + + DISALLOW_COPY_AND_ASSIGN(WebDataServiceBase); }; #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BASE_H_ diff --git a/components/webdata/common/web_data_service_test_util.cc b/components/webdata/common/web_data_service_test_util.cc index 2720721..0ece6a4 100644 --- a/components/webdata/common/web_data_service_test_util.cc +++ b/components/webdata/common/web_data_service_test_util.cc @@ -22,8 +22,8 @@ void MockWebDataServiceWrapperBase::Shutdown() { // all the webdatas in. MockWebDataServiceWrapper::MockWebDataServiceWrapper( scoped_refptr<WebDataService> fake_service, - scoped_refptr<AutofillWebDataService> fake_autofill, - scoped_refptr<TokenWebData> fake_token) + AutofillWebDataService* fake_autofill, + TokenWebData* fake_token) : fake_autofill_web_data_(fake_autofill), fake_token_web_data_(fake_token), fake_web_data_(fake_service) { @@ -32,13 +32,13 @@ MockWebDataServiceWrapper::MockWebDataServiceWrapper( MockWebDataServiceWrapper::~MockWebDataServiceWrapper() { } -scoped_refptr<AutofillWebDataService> +AutofillWebDataService* MockWebDataServiceWrapper::GetAutofillWebData() { - return fake_autofill_web_data_; + return fake_autofill_web_data_.get(); } -scoped_refptr<TokenWebData> MockWebDataServiceWrapper::GetTokenWebData() { - return fake_token_web_data_; +TokenWebData* MockWebDataServiceWrapper::GetTokenWebData() { + return fake_token_web_data_.get(); } scoped_refptr<WebDataService> MockWebDataServiceWrapper::GetWebData() { diff --git a/components/webdata/common/web_data_service_test_util.h b/components/webdata/common/web_data_service_test_util.h index 4f0f6e5..6fb3b63 100644 --- a/components/webdata/common/web_data_service_test_util.h +++ b/components/webdata/common/web_data_service_test_util.h @@ -58,21 +58,20 @@ class MockWebDataServiceWrapper : public MockWebDataServiceWrapperBase { public: MockWebDataServiceWrapper( scoped_refptr<WebDataService> fake_service, - scoped_refptr<autofill::AutofillWebDataService> fake_autofill, - scoped_refptr<TokenWebData> fake_token); + autofill::AutofillWebDataService* fake_autofill, + TokenWebData* fake_token); virtual ~MockWebDataServiceWrapper(); - virtual scoped_refptr<autofill::AutofillWebDataService> - GetAutofillWebData() OVERRIDE; + virtual autofill::AutofillWebDataService* GetAutofillWebData() OVERRIDE; - virtual scoped_refptr<TokenWebData> GetTokenWebData() OVERRIDE; + virtual TokenWebData* GetTokenWebData() OVERRIDE; virtual scoped_refptr<WebDataService> GetWebData() OVERRIDE; protected: - scoped_refptr<autofill::AutofillWebDataService> fake_autofill_web_data_; - scoped_refptr<TokenWebData> fake_token_web_data_; + scoped_ptr<autofill::AutofillWebDataService> fake_autofill_web_data_; + scoped_ptr<TokenWebData> fake_token_web_data_; scoped_refptr<WebDataService> fake_web_data_; private: |