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

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

Issue 2828021: Take 2: sync changes to support encryption (Closed)
Patch Set: fix flaky password test under valgrind Created 10 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 fc9fa31e70ede68c4fcd4ce75579e801ff8c70b1..be20013e3bb296cbe4b5ba5569db2d3f4a5143df 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -116,6 +116,9 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
// Called on |frontend_loop_| to start syncing.
void StartSyncing();
+ // Called on |frontend_loop_| to asynchronously set the passphrase.
+ void SetPassphrase(const std::string& passphrase);
+
// Called on |frontend_loop_| to kick off shutdown.
// |sync_disabled| indicates if syncing is being disabled or not.
// See the implementation and Core::DoShutdown for details.
@@ -191,6 +194,7 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
registrar_.routing_info[syncable::AUTOFILL] = GROUP_PASSIVE;
registrar_.routing_info[syncable::THEMES] = GROUP_PASSIVE;
registrar_.routing_info[syncable::TYPED_URLS] = GROUP_PASSIVE;
+ registrar_.routing_info[syncable::NIGORI] = GROUP_PASSIVE;
registrar_.routing_info[syncable::PASSWORDS] = GROUP_PASSIVE;
core_thread_.message_loop()->PostTask(FROM_HERE,
@@ -224,6 +228,8 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
const sessions::SyncSessionSnapshot* snapshot);
virtual void OnInitializationComplete();
virtual void OnAuthError(const GoogleServiceAuthError& auth_error);
+ virtual void OnPassphraseRequired();
+ virtual void OnPassphraseAccepted();
virtual void OnPaused();
virtual void OnResumed();
@@ -284,6 +290,10 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
// syncing (generally after initialization and authentication).
void DoStartSyncing();
+ // Called on our SyncBackendHost's |core_thread_| to set the passphrase
+ // on behalf of SyncBackendHost::SupplyPassphrase.
+ void DoSetPassphrase(const std::string& passphrase);
+
// The shutdown order is a bit complicated:
// 1) From |core_thread_|, invoke the syncapi Shutdown call to do a final
// SaveChanges, close sqlite handles, and halt the syncer thread (which
@@ -360,6 +370,12 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
void HandleAuthErrorEventOnFrontendLoop(
const GoogleServiceAuthError& new_auth_error);
+ // Invoked when a passphrase is required to decrypt a set of Nigori keys.
+ void NotifyPassphraseRequired();
+
+ // Invoked when the passphrase provided by the user has been accepted.
+ void NotifyPassphraseAccepted();
+
// Called from Core::OnSyncCycleCompleted to handle updating frontend
// thread components.
void HandleSyncCycleCompletedOnFrontendLoop(
« no previous file with comments | « chrome/browser/sync/glue/password_model_associator.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