Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4565)

Unified Diff: chrome/browser/chromeos/gdata/gdata_cache.cc

Issue 10837061: gdata: Make WeakPtrFactory the last parameter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and reorder Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/gdata/gdata_cache.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_cache.cc b/chrome/browser/chromeos/gdata/gdata_cache.cc
index 889f7720aa301682601c8d407dada9662c66dda4..4c9ae4c313f1aa5b2f953025cb73826b2ef78338 100644
--- a/chrome/browser/chromeos/gdata/gdata_cache.cc
+++ b/chrome/browser/chromeos/gdata/gdata_cache.cc
@@ -324,8 +324,7 @@ GDataCache::GDataCache(const FilePath& cache_root_path,
: cache_root_path_(cache_root_path),
cache_paths_(GetCachePaths(cache_root_path_)),
blocking_task_runner_(blocking_task_runner),
- ui_weak_ptr_factory_(this),
- ui_weak_ptr_(ui_weak_ptr_factory_.GetWeakPtr()) {
+ weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
@@ -542,7 +541,7 @@ void GDataCache::PinOnUIThread(const std::string& resource_id,
GDataCache::FILE_OPERATION_MOVE,
error),
base::Bind(&GDataCache::OnPinned,
- ui_weak_ptr_,
+ weak_ptr_factory_.GetWeakPtr(),
base::Owned(error),
resource_id,
md5,
@@ -564,7 +563,7 @@ void GDataCache::UnpinOnUIThread(const std::string& resource_id,
GDataCache::FILE_OPERATION_MOVE,
error),
base::Bind(&GDataCache::OnUnpinned,
- ui_weak_ptr_,
+ weak_ptr_factory_.GetWeakPtr(),
base::Owned(error),
resource_id,
md5,
@@ -634,7 +633,7 @@ void GDataCache::CommitDirtyOnUIThread(const std::string& resource_id,
GDataCache::FILE_OPERATION_MOVE,
error),
base::Bind(&GDataCache::OnCommitDirty,
- ui_weak_ptr_,
+ weak_ptr_factory_.GetWeakPtr(),
base::Owned(error),
resource_id,
md5,
@@ -719,7 +718,7 @@ void GDataCache::DestroyOnUIThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Invalidate the weak pointer.
- ui_weak_ptr_factory_.InvalidateWeakPtrs();
+ weak_ptr_factory_.InvalidateWeakPtrs();
// Destroy myself on the blocking pool.
blocking_task_runner_->PostTask(
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_cache.h ('k') | chrome/browser/chromeos/gdata/gdata_download_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698