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

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

Issue 10520010: Not for review: Support sync init with missing or corrupt store (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Documentation Created 8 years, 6 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/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 e8785540b6a47ef3a10edc16b1fb3ac89138d725..880568e0008fce55d504e49ef4843cd5dc8b050c 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -171,7 +171,6 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
void Initialize(SyncFrontend* frontend,
const WeakHandle<JsEventHandler>& event_handler,
const GURL& service_url,
- syncable::ModelTypeSet initial_types,
const sync_api::SyncCredentials& credentials,
bool delete_sync_data_folder,
UnrecoverableErrorHandler* unrecoverable_error_handler,
@@ -290,6 +289,32 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
typedef base::Callback<sync_api::HttpPostProviderFactory*(void)>
MakeHttpBridgeFactoryFn;
+ struct PendingConfigureDataTypesState {
+ PendingConfigureDataTypesState();
+ ~PendingConfigureDataTypesState();
+
+ // The ready_task will be run when configuration is done with the
+ // set of all types that failed configuration (i.e., if its
+ // argument is non-empty, then an error was encountered).
+ base::Callback<void(syncable::ModelTypeSet)> ready_task;
+
+ // The retry callback will be run when the download failed due to a
+ // transient error. This is to notify DTM so it can apropriately inform
+ // the UI. Note: The retry_callback will be run only once and after
+ // that we will not notify DTM until the sync is successful or in a
+ // permanent error state.
+ base::Callback<void()> retry_callback;
+
+ // The set of types that we are waiting to be initially synced in a
+ // configuration cycle.
+ syncable::ModelTypeSet types_to_add;
+
+ // Additional details about which types were added.
+ syncable::ModelTypeSet added_types;
+ sync_api::ConfigureReason reason;
+ bool retry_in_progress;
+ };
+
struct DoInitializeOptions {
DoInitializeOptions(
MessageLoop* sync_loop,
@@ -342,7 +367,8 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// configuration mode.
void FinishConfigureDataTypesOnFrontendLoop();
- bool IsDownloadingNigoriForTest() const;
+ scoped_ptr<PendingConfigureDataTypesState> pending_download_state_;
rlarocque 2012/06/04 20:07:09 The moves in this file were necessary to make pend
+ scoped_ptr<PendingConfigureDataTypesState> pending_config_mode_state_;
private:
// The real guts of SyncBackendHost, to keep the public client API clean.
@@ -365,32 +391,6 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
INITIALIZED, // Initialization is complete.
};
- struct PendingConfigureDataTypesState {
- PendingConfigureDataTypesState();
- ~PendingConfigureDataTypesState();
-
- // The ready_task will be run when configuration is done with the
- // set of all types that failed configuration (i.e., if its
- // argument is non-empty, then an error was encountered).
- base::Callback<void(syncable::ModelTypeSet)> ready_task;
-
- // The retry callback will be run when the download failed due to a
- // transient error. This is to notify DTM so it can apropriately inform
- // the UI. Note: The retry_callback will be run only once and after
- // that we will not notify DTM until the sync is successful or in a
- // permanent error state.
- base::Callback<void()> retry_callback;
-
- // The set of types that we are waiting to be initially synced in a
- // configuration cycle.
- syncable::ModelTypeSet types_to_add;
-
- // Additional details about which types were added.
- syncable::ModelTypeSet added_types;
- sync_api::ConfigureReason reason;
- bool retry_in_progress;
- };
-
// Checks if we have received a notice to turn on experimental datatypes
// (via the nigori node) and informs the frontend if that is the case.
// Note: it is illegal to call this before the backend is initialized.
@@ -467,6 +467,11 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
const WeakHandle<JsBackend>& js_backend,
syncable::ModelTypeSet failed_configuration_types);
+ // Called when the SyncManager has been constructed and initialized.
+ void HandleSyncManagerInitializationOnFrontendLoop(
+ const WeakHandle<JsBackend>& js_backend, bool success,
+ syncable::ModelTypeSet initial_sync_ended_types);
+
// Must be called on |frontend_loop_|. |done_callback| is called on
// |frontend_loop_|.
void RefreshNigori(const base::Closure& done_callback);
@@ -509,9 +514,6 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// The frontend which we serve (and are owned by).
SyncFrontend* frontend_;
- scoped_ptr<PendingConfigureDataTypesState> pending_download_state_;
- scoped_ptr<PendingConfigureDataTypesState> pending_config_mode_state_;
-
// We cache the cryptographer's pending keys whenever NotifyPassphraseRequired
// is called. This way, before the UI calls SetDecryptionPassphrase on the
// syncer, it can avoid the overhead of an asynchronous decryption call and
« no previous file with comments | « no previous file | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | chrome/browser/sync/glue/sync_backend_registrar.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698