summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/profile_sync_service.h
diff options
context:
space:
mode:
authorchron@chromium.org <chron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-25 01:47:54 +0000
committerchron@chromium.org <chron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-25 01:47:54 +0000
commitca02b57fb29c8412e0558b4696ba7fd17acca687 (patch)
treec993e072d0700ef8078226b89fca62491f011a4a /chrome/browser/sync/profile_sync_service.h
parent31f6e2b73cf0f4350238f6d85a0139ca2c77dd90 (diff)
downloadchromium_src-ca02b57fb29c8412e0558b4696ba7fd17acca687.zip
chromium_src-ca02b57fb29c8412e0558b4696ba7fd17acca687.tar.gz
chromium_src-ca02b57fb29c8412e0558b4696ba7fd17acca687.tar.bz2
Revert 39964 - Move data type start/stop management into DataTypeManager
This change introduces a new interface/class called DataTypeManager whose job is to choreograph the start up and shut down of all registered data types. It starts each data type serially, waiting for each data type to finish starting before starting the next one. If anything goes wrong on startup, all data types are stopped. Note that this change also simplifies the ProfileSyncServiceStartupTest as many of the cases it tested for are now the responsibility of the DataTypeManagerImpl (and these are thoroughly tested in its unit test). I also killed off the TestProfileSyncFactory in the ProfileSyncServiceTest since it was lame and could be done with the mock. BUG=36506 Review URL: http://codereview.chromium.org/650175 TBR=skrul@chromium.org Review URL: http://codereview.chromium.org/661053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/profile_sync_service.h')
-rw-r--r--chrome/browser/sync/profile_sync_service.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 109e814..ce36f98 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -15,7 +15,6 @@
#include "chrome/browser/google_service_auth_error.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/sync/glue/data_type_controller.h"
-#include "chrome/browser/sync/glue/data_type_manager.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
#include "chrome/browser/sync/notification_method.h"
#include "chrome/browser/sync/sync_setup_wizard.h"
@@ -23,8 +22,6 @@
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
-class ProfileSyncFactory;
-
namespace browser_sync {
class ChangeProcessor;
@@ -89,9 +86,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
MAX_SYNC_EVENT_CODE
};
- ProfileSyncService(ProfileSyncFactory* factory_,
- Profile* profile,
- bool bootstrap_sync_authentication);
+ ProfileSyncService(Profile* profile, bool bootstrap_sync_authentication);
virtual ~ProfileSyncService();
// Initializes the object. This should be called every time an object of this
@@ -241,8 +236,10 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
void RegisterPreferences();
void ClearPreferences();
- void DataTypeManagerStartCallback(
- browser_sync::DataTypeManager::StartResult result);
+ void BookmarkStartCallback(
+ browser_sync::DataTypeController::StartResult result);
+ void PreferenceStartCallback(
+ browser_sync::DataTypeController::StartResult result);
// Tests need to override this. If |delete_sync_data_folder| is true, then
// this method will delete all previous "Sync Data" folders. (useful if the
@@ -274,15 +271,15 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// store to bootstrap the authentication process.
virtual std::string GetLsidForAuthBootstraping();
+ // Stops a data type.
+ void StopDataType(syncable::ModelType model_type);
+
// Time at which we begin an attempt a GAIA authorization.
base::TimeTicks auth_start_time_;
// Time at which error UI is presented for the new tab page.
base::TimeTicks auth_error_time_;
- // Factory used to create various dependent objects.
- ProfileSyncFactory* factory_;
-
// The profile whose data we are synchronizing.
Profile* profile_;
@@ -342,9 +339,6 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// Which peer-to-peer notification method to use.
browser_sync::NotificationMethod notification_method_;
- // Manages the start and stop of the various data types.
- scoped_ptr<browser_sync::DataTypeManager> data_type_manager_;
-
ObserverList<Observer> observers_;
DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);