summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browsing_data_indexed_db_helper.cc
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 23:35:44 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 23:35:44 +0000
commit3f2f5f05a2a9afe503e0c4e13a8dad87ab214b14 (patch)
tree1177d24b6ca5f81de4a0d0ae0b748cd596d5beaf /chrome/browser/browsing_data_indexed_db_helper.cc
parentd2981f38a23525812f2030cf68a5ef6259e30fb7 (diff)
downloadchromium_src-3f2f5f05a2a9afe503e0c4e13a8dad87ab214b14.zip
chromium_src-3f2f5f05a2a9afe503e0c4e13a8dad87ab214b14.tar.gz
chromium_src-3f2f5f05a2a9afe503e0c4e13a8dad87ab214b14.tar.bz2
Use WeakPtrFactory in CookieTreeModel instead of explicit cancellation on destruction.
BUG=121863 TEST=trybots Review URL: https://chromiumcodereview.appspot.com/9968112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130767 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data_indexed_db_helper.cc')
-rw-r--r--chrome/browser/browsing_data_indexed_db_helper.cc27
1 files changed, 4 insertions, 23 deletions
diff --git a/chrome/browser/browsing_data_indexed_db_helper.cc b/chrome/browser/browsing_data_indexed_db_helper.cc
index 5794a62..c18db05 100644
--- a/chrome/browser/browsing_data_indexed_db_helper.cc
+++ b/chrome/browser/browsing_data_indexed_db_helper.cc
@@ -33,7 +33,6 @@ class BrowsingDataIndexedDBHelperImpl : public BrowsingDataIndexedDBHelper {
virtual void StartFetching(
const base::Callback<void(const std::list<IndexedDBInfo>&)>&
callback) OVERRIDE;
- virtual void CancelNotification() OVERRIDE;
virtual void DeleteIndexedDB(const GURL& origin) OVERRIDE;
private:
@@ -88,11 +87,6 @@ void BrowsingDataIndexedDBHelperImpl::StartFetching(
this));
}
-void BrowsingDataIndexedDBHelperImpl::CancelNotification() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- completion_callback_.Reset();
-}
-
void BrowsingDataIndexedDBHelperImpl::DeleteIndexedDB(
const GURL& origin) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -126,12 +120,8 @@ void BrowsingDataIndexedDBHelperImpl::FetchIndexedDBInfoInWebKitThread() {
void BrowsingDataIndexedDBHelperImpl::NotifyInUIThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(is_fetching_);
- // Note: completion_callback_ mutates only in the UI thread, so it's safe to
- // test it here.
- if (!completion_callback_.is_null()) {
- completion_callback_.Run(indexed_db_info_);
- completion_callback_.Reset();
- }
+ completion_callback_.Run(indexed_db_info_);
+ completion_callback_.Reset();
is_fetching_ = false;
}
@@ -260,16 +250,7 @@ void CannedBrowsingDataIndexedDBHelper::NotifyInUIThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(is_fetching_);
- // Completion_callback_ mutates only in the UI thread, so it's safe to test it
- // here.
- if (!completion_callback_.is_null()) {
- completion_callback_.Run(indexed_db_info_);
- completion_callback_.Reset();
- }
- is_fetching_ = false;
-}
-
-void CannedBrowsingDataIndexedDBHelper::CancelNotification() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ completion_callback_.Run(indexed_db_info_);
completion_callback_.Reset();
+ is_fetching_ = false;
}