diff options
author | caitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-29 21:32:34 +0000 |
---|---|---|
committer | caitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-29 21:32:34 +0000 |
commit | 4c53e892ddba2acd5fab7dc99105f09d5f25a7c3 (patch) | |
tree | 7b9bd7097c5f1d56e4b658e8f8fc003bc392a6d8 /components/webdata/common | |
parent | 611ae29a72a8cb343679767f454fed6d0c71b771 (diff) | |
download | chromium_src-4c53e892ddba2acd5fab7dc99105f09d5f25a7c3.zip chromium_src-4c53e892ddba2acd5fab7dc99105f09d5f25a7c3.tar.gz chromium_src-4c53e892ddba2acd5fab7dc99105f09d5f25a7c3.tar.bz2 |
Move SupportsUserData code into AutofillWebData, so base class can live completely on UI thread.
(depends on https://codereview.chromium.org/14103021/)
TBR=akalin@chromium.org (c/b/sync)
BUG=230920
Review URL: https://chromiumcodereview.appspot.com/13898011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/webdata/common')
-rw-r--r-- | components/webdata/common/web_data_service_base.cc | 16 | ||||
-rw-r--r-- | components/webdata/common/web_data_service_base.h | 25 |
2 files changed, 0 insertions, 41 deletions
diff --git a/components/webdata/common/web_data_service_base.cc b/components/webdata/common/web_data_service_base.cc index e1a67a5..9b36197 100644 --- a/components/webdata/common/web_data_service_base.cc +++ b/components/webdata/common/web_data_service_base.cc @@ -45,9 +45,6 @@ void WebDataServiceBase::WebDatabaseLoadFailed(sql::InitStatus status) { void WebDataServiceBase::ShutdownOnUIThread() { db_loaded_ = false; - BrowserThread::PostTask( - BrowserThread::DB, FROM_HERE, - base::Bind(&WebDataServiceBase::ShutdownOnDBThread, this)); } void WebDataServiceBase::Init() { @@ -100,18 +97,5 @@ WebDatabase* WebDataServiceBase::GetDatabase() { return wdbs_->GetDatabaseOnDB(); } -base::SupportsUserData* WebDataServiceBase::GetDBUserData() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); - if (!db_thread_user_data_) - db_thread_user_data_.reset(new SupportsUserDataAggregatable()); - return db_thread_user_data_.get(); -} - WebDataServiceBase::~WebDataServiceBase() { - DCHECK(!db_thread_user_data_.get()) << "Forgot to call ShutdownOnUIThread?"; -} - -void WebDataServiceBase::ShutdownOnDBThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); - db_thread_user_data_.reset(); } diff --git a/components/webdata/common/web_data_service_base.h b/components/webdata/common/web_data_service_base.h index 2ce81a0..9e0867d 100644 --- a/components/webdata/common/web_data_service_base.h +++ b/components/webdata/common/web_data_service_base.h @@ -9,7 +9,6 @@ #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "base/supports_user_data.h" #include "components/webdata/common/web_database_observer.h" #include "components/webdata/common/webdata_export.h" #include "content/public/browser/browser_thread.h" @@ -89,15 +88,8 @@ class WEBDATA_EXPORT WebDataServiceBase // DBThread. virtual WebDatabase* GetDatabase(); - // Returns a SupportsUserData objects that may be used to store data - // owned by the DB thread on this object. Should be called only from - // the DB thread, and will be destroyed on the DB thread soon after - // |ShutdownOnUIThread()| is called. - base::SupportsUserData* GetDBUserData(); - protected: virtual ~WebDataServiceBase(); - virtual void ShutdownOnDBThread(); // Our database service. scoped_refptr<WebDatabaseService> wdbs_; @@ -114,23 +106,6 @@ class WEBDATA_EXPORT WebDataServiceBase content::BrowserThread::DeleteOnUIThread>; ProfileErrorCallback profile_error_callback_; - - // This makes the destructor public, and thus allows us to aggregate - // SupportsUserData. It is private by default to prevent incorrect - // usage in class hierarchies where it is inherited by - // reference-counted objects. - class SupportsUserDataAggregatable : public base::SupportsUserData { - public: - SupportsUserDataAggregatable() {} - virtual ~SupportsUserDataAggregatable() {} - private: - DISALLOW_COPY_AND_ASSIGN(SupportsUserDataAggregatable); - }; - - // Storage for user data to be accessed only on the DB thread. May - // be used e.g. for SyncableService subclasses that need to be owned - // by this object. Is created on first call to |GetDBUserData()|. - scoped_ptr<SupportsUserDataAggregatable> db_thread_user_data_; }; #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_SERVICE_BASE_H_ |