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

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

Issue 6690020: sync: hook up ServerConnectionManager <> SyncerThread2 and tie up more loose ends (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/debug
Patch Set: fix Created 9 years, 9 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
« no previous file with comments | « chrome/browser/sync/engine/update_applicator.cc ('k') | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/sync_backend_host.h
diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h
index 1349c6015d4b27098cf2b7173fda97ab2ad58d92..b18fce9ddff519663b1164311a15eaa137563657 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -388,6 +388,9 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
const std::string& name, const JsArgList& args,
const JsEventHandler* sender);
+ // A callback from the SyncerThread when it is safe to continue config.
+ void FinishConfigureDataTypes();
+
#if defined(UNIT_TEST)
// Special form of initialization that does not try and authenticate the
// last known user (since it will fail in test mode) and does some extra
@@ -482,6 +485,8 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
const std::string& name, const JsArgList& args,
const JsEventHandler* dst);
+ void FinishConfigureDataTypesOnFrontendLoop();
+
// Return true if a model lives on the current thread.
bool IsCurrentThreadSafeForModel(syncable::ModelType model_type);
@@ -522,6 +527,11 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
// Posts a config request on the core thread.
virtual void RequestConfig(const syncable::ModelTypeBitSet& added_types);
+ // Called to finish the job of ConfigureDataTypes once the syncer is in
+ // configuration mode.
+ void FinishConfigureDataTypes();
+ void FinishConfigureDataTypesOnFrontendLoop();
+
// Allows tests to perform alternate core initialization work.
virtual void InitCore(const Core::DoInitializeOptions& options);
@@ -548,12 +558,6 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
void ConfigureAutofillMigration();
- // Depending on switches::kUseNewSyncerThread, kicks the syncapi to respond
- // to a change in the set of enabled data types.
- void ScheduleSyncEventForConfigChange(
- bool deleted_type,
- const syncable::ModelTypeBitSet& added_types);
-
// A thread we dedicate for use by our Core to perform initialization,
// authentication, handle messages from the syncapi, and periodically tell
// the syncapi to persist itself.
@@ -600,13 +604,23 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
// Path of the folder that stores the sync data files.
FilePath sync_data_folder_path_;
- // A task that should be called once data type configuration is
- // complete.
- scoped_ptr<CancelableTask> configure_ready_task_;
+ struct PendingConfigureDataTypesState {
+ PendingConfigureDataTypesState();
+ // A task that should be called once data type configuration is
+ // complete.
+ scoped_ptr<CancelableTask> ready_task;
+
+ // The set of types that we are waiting to be initially synced in a
+ // configuration cycle.
+ syncable::ModelTypeSet initial_types;
+
+ // Additional details about which types were added / removed.
+ bool deleted_type;
+ syncable::ModelTypeBitSet added_types;
+ };
- // The set of types that we are waiting to be initially synced in a
- // configuration cycle.
- syncable::ModelTypeSet configure_initial_sync_types_;
+ scoped_ptr<PendingConfigureDataTypesState> pending_download_state_;
+ scoped_ptr<PendingConfigureDataTypesState> pending_config_mode_state_;
// UI-thread cache of the last AuthErrorState received from syncapi.
GoogleServiceAuthError last_auth_error_;
« no previous file with comments | « chrome/browser/sync/engine/update_applicator.cc ('k') | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698