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

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

Issue 9232011: sync: Make ProfileSyncService a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: init Created 8 years, 11 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/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 9e04c87f6eb62ee0795a37812bee499976f00c65..e3ae235d92e167f72456825aa4da49560b4957f7 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -19,6 +19,7 @@
#include "base/string16.h"
#include "base/time.h"
#include "base/timer.h"
+#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/sync/backend_unrecoverable_error_handler.h"
#include "chrome/browser/sync/engine/model_safe_worker.h"
#include "chrome/browser/sync/failed_datatypes_handler.h"
@@ -103,6 +104,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
public browser_sync::SyncPrefObserver,
public browser_sync::UnrecoverableErrorHandler,
public content::NotificationObserver,
+ public ProfileKeyedService,
// TODO(lipalani): crbug.com/100829. Instead of
// doing this vend weak pointers from a factory.
public base::SupportsWeakPtr<ProfileSyncService> {
@@ -322,6 +324,8 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// Returns a user-friendly string form of last synced time (in minutes).
virtual string16 GetLastSyncedTimeString() const;
+ ProfileSyncComponentsFactory* factory() { return factory_.get(); }
+
// The profile we are syncing for.
Profile* profile() const { return profile_; }
@@ -482,6 +486,9 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
virtual const FailedDatatypesHandler& failed_datatypes_handler();
+ // ProfileKeyedService implementation.
+ virtual void Shutdown();
+
protected:
// Used by test classes that derive from ProfileSyncService.
virtual browser_sync::SyncBackendHost* GetBackendForTest();
@@ -493,7 +500,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
void StartUp();
// Shuts down the backend sync components.
// |sync_disabled| indicates if syncing is being disabled or not.
- void Shutdown(bool sync_disabled);
+ void ShutdownImpl(bool sync_disabled);
// Return SyncCredentials from the TokenService.
sync_api::SyncCredentials GetCredentials();
@@ -586,7 +593,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
base::TimeTicks auth_error_time_;
// Factory used to create various dependent objects.
- ProfileSyncComponentsFactory* factory_;
+ scoped_ptr<ProfileSyncComponentsFactory> factory_;
// The profile whose data we are synchronizing.
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698