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

Unified Diff: chrome/browser/chromeos/gdata/gdata_operation_runner.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_operation_runner.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_operation_runner.cc b/chrome/browser/chromeos/gdata/gdata_operation_runner.cc
index 0705c387e11cdd2c953e9b6c4f6db76437057fe0..2bd8151f4a03ffa900b8aea3824e46f69eeaedb7 100644
--- a/chrome/browser/chromeos/gdata/gdata_operation_runner.cc
+++ b/chrome/browser/chromeos/gdata/gdata_operation_runner.cc
@@ -17,8 +17,7 @@ GDataOperationRunner::GDataOperationRunner(Profile* profile)
: profile_(profile),
auth_service_(new GDataAuthService()),
operation_registry_(new GDataOperationRegistry()),
- weak_ptr_factory_(this),
- weak_ptr_bound_to_ui_thread_(weak_ptr_factory_.GetWeakPtr()) {
+ weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
auth_service_->AddObserver(this);
}
@@ -50,7 +49,7 @@ void GDataOperationRunner::StartOperationWithRetry(
// The re-authenticatation callback will run on UI thread.
operation->SetReAuthenticateCallback(
base::Bind(&GDataOperationRunner::RetryOperation,
- weak_ptr_bound_to_ui_thread_));
+ weak_ptr_factory_.GetWeakPtr()));
StartOperation(operation);
}
@@ -62,7 +61,7 @@ void GDataOperationRunner::StartOperation(GDataOperationInterface* operation) {
auth_service_->StartAuthentication(
operation_registry_.get(),
base::Bind(&GDataOperationRunner::OnOperationAuthRefresh,
- weak_ptr_bound_to_ui_thread_,
+ weak_ptr_factory_.GetWeakPtr(),
operation));
return;
}
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_operation_runner.h ('k') | chrome/browser/chromeos/gdata/gdata_sync_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698