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

Unified Diff: chrome/browser/sync/profile_sync_service.h

Issue 795003003: Make ProfileSyncService's WeakPtrFactory the last member (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use scoped_ptr Created 6 years 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
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index eadf77cb968155491db162b2f97dbf075fb52045..c7c019464dae24b889c485eeaccee66ed359e067 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -1113,16 +1113,6 @@ class ProfileSyncService : public ProfileSyncServiceBase,
base::OneShotTimer<ProfileSyncService> request_access_token_retry_timer_;
net::BackoffEntry request_access_token_backoff_;
- base::WeakPtrFactory<ProfileSyncService> weak_factory_;
-
- // We don't use |weak_factory_| for the StartupController because the weak
- // ptrs should be bound to the lifetime of ProfileSyncService and not to the
- // [Initialize -> sync disabled/shutdown] lifetime. We don't pass
- // StartupController an Unretained reference to future-proof against
- // the controller impl changing to post tasks. Therefore, we have a separate
- // factory.
- base::WeakPtrFactory<ProfileSyncService> startup_controller_weak_factory_;
-
// States related to sync token and connection.
base::Time connection_status_update_time_;
syncer::ConnectionStatus connection_status_;
@@ -1139,9 +1129,10 @@ class ProfileSyncService : public ProfileSyncServiceBase,
scoped_ptr<syncer::NetworkResources> network_resources_;
- browser_sync::StartupController startup_controller_;
+ scoped_ptr<browser_sync::StartupController> startup_controller_;
- browser_sync::BackupRollbackController backup_rollback_controller_;
+ scoped_ptr<browser_sync::BackupRollbackController>
+ backup_rollback_controller_;
// Mode of current backend.
BackendMode backend_mode_;
@@ -1167,6 +1158,16 @@ class ProfileSyncService : public ProfileSyncServiceBase,
// The full path to the sync data directory.
base::FilePath directory_path_;
+ base::WeakPtrFactory<ProfileSyncService> weak_factory_;
+
+ // We don't use |weak_factory_| for the StartupController because the weak
+ // ptrs should be bound to the lifetime of ProfileSyncService and not to the
+ // [Initialize -> sync disabled/shutdown] lifetime. We don't pass
+ // StartupController an Unretained reference to future-proof against
+ // the controller impl changing to post tasks. Therefore, we have a separate
+ // factory.
+ base::WeakPtrFactory<ProfileSyncService> startup_controller_weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
};
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698