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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 26594002: Chrome sync: Put WeakPtrFactory members at the end (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge (see prior patch for try jobs) Created 7 years, 2 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/sync/glue/sync_backend_host.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 2ce1d56c86aabc26c58a83c662ae5563cc9a1a90..9df6acf9579190cfe168a1acac4ceff5ea92d4a9 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -291,8 +291,6 @@ class SyncBackendHost::Core
// The top-level syncapi entry point. Lives on the sync thread.
scoped_ptr<syncer::SyncManager> sync_manager_;
- base::WeakPtrFactory<Core> weak_ptr_factory_;
-
// These signals allow us to send requests to shut down the HttpBridgeFactory
// and ServerConnectionManager without having to wait for those classes to
// finish initializing first.
@@ -301,6 +299,8 @@ class SyncBackendHost::Core
syncer::CancelationSignal release_request_context_signal_;
syncer::CancelationSignal stop_syncing_signal_;
+ base::WeakPtrFactory<Core> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(Core);
};
@@ -308,30 +308,30 @@ SyncBackendHost::SyncBackendHost(
const std::string& name,
Profile* profile,
const base::WeakPtr<SyncPrefs>& sync_prefs)
- : weak_ptr_factory_(this),
- frontend_loop_(base::MessageLoop::current()),
+ : frontend_loop_(base::MessageLoop::current()),
profile_(profile),
name_(name),
- core_(new Core(name_, profile_->GetPath().Append(kSyncDataFolderName),
- weak_ptr_factory_.GetWeakPtr())),
initialization_state_(NOT_ATTEMPTED),
sync_prefs_(sync_prefs),
frontend_(NULL),
cached_passphrase_type_(syncer::IMPLICIT_PASSPHRASE),
invalidator_(
invalidation::InvalidationServiceFactory::GetForProfile(profile)),
- invalidation_handler_registered_(false) {
+ invalidation_handler_registered_(false),
+ weak_ptr_factory_(this) {
+ core_ = new Core(name_, profile_->GetPath().Append(kSyncDataFolderName),
+ weak_ptr_factory_.GetWeakPtr());
}
SyncBackendHost::SyncBackendHost(Profile* profile)
- : weak_ptr_factory_(this),
- frontend_loop_(base::MessageLoop::current()),
+ : frontend_loop_(base::MessageLoop::current()),
profile_(profile),
name_("Unknown"),
initialization_state_(NOT_ATTEMPTED),
frontend_(NULL),
cached_passphrase_type_(syncer::IMPLICIT_PASSPHRASE),
- invalidation_handler_registered_(false) {
+ invalidation_handler_registered_(false),
+ weak_ptr_factory_(this) {
}
SyncBackendHost::~SyncBackendHost() {

Powered by Google App Engine
This is Rietveld 408576698