summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/profile_sync_factory.h
diff options
context:
space:
mode:
authorskrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 21:56:00 +0000
committerskrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 21:56:00 +0000
commit9348c1f762db498d399d07c0295e36d75ee7fa08 (patch)
treee07350bf22f6768734e2e444b048fb24498f0f8f /chrome/browser/sync/profile_sync_factory.h
parent017f95fdd71c853a98777b57eca08b0e6ea49a7b (diff)
downloadchromium_src-9348c1f762db498d399d07c0295e36d75ee7fa08.zip
chromium_src-9348c1f762db498d399d07c0295e36d75ee7fa08.tar.gz
chromium_src-9348c1f762db498d399d07c0295e36d75ee7fa08.tar.bz2
Pause the sync thread while starting data types.
A few things to note: - I ended the plubming (it's-a me, mario!) at the SyncBackendHost (the PSS does not know about pausing). The SyncBackendHost now has RequestPause/RequestResume methods. The notifications that are sent when pause and resume is complete are dispatched to the notification service by the SyncBackendHost. - Calls to SHB::Request(Pause|Resume) go directly to the similar named methods on the SyncerThread. This is unlike other methods on the SHB which are usually dispatched to the "core" thread before calling deeper into the onion. I did this to avoid having to deal with callbacks to carry the result value of pause/resume (since the methods can fail and return false). If this is a problem I can change the way it works. - There is a little trickery regarding the integration unit tests since we typically use a specially initialized SBH for these tests, and the syncer thread does not really run for these tests. Since the thread is not running, pause and resume won't work properly. To get around this, the DataTypeManagerImpl in these tests is constructed with a mock SBH that will respond properly to pause and resume requests. BUG=37154,37553 Review URL: http://codereview.chromium.org/1063002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41883 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/profile_sync_factory.h')
-rw-r--r--chrome/browser/sync/profile_sync_factory.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/sync/profile_sync_factory.h b/chrome/browser/sync/profile_sync_factory.h
index 6aef77f..ae61f05 100644
--- a/chrome/browser/sync/profile_sync_factory.h
+++ b/chrome/browser/sync/profile_sync_factory.h
@@ -17,6 +17,7 @@ class WebDatabase;
namespace browser_sync {
class DataTypeManager;
+class SyncBackendHost;
class UnrecoverableErrorHandler;
}
@@ -42,9 +43,11 @@ class ProfileSyncFactory {
// is owned by the caller.
virtual ProfileSyncService* CreateProfileSyncService() = 0;
- // Instantiates a new DataTypeManager with a list of data type
- // controllers. The return pointer is owned by the caller.
+ // Instantiates a new DataTypeManager with a SyncBackendHost and a
+ // list of data type controllers. The return pointer is owned by
+ // the caller.
virtual browser_sync::DataTypeManager* CreateDataTypeManager(
+ browser_sync::SyncBackendHost* backend,
const browser_sync::DataTypeController::TypeMap& controllers) = 0;
// Instantiates both a model associator and change processor for the