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

Unified Diff: sync/internal_api/sync_manager_impl.h

Issue 10825137: FYI: Control Data + Per-Device Metadata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add PER_USER_METADATA, refactor some encryption code Created 8 years, 4 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: sync/internal_api/sync_manager_impl.h
diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h
index 1c4541fdf1b31b2ac5607dc19057d119834f23d0..34b664c8d00c4020777ec284ecc43358a562fa88 100644
--- a/sync/internal_api/sync_manager_impl.h
+++ b/sync/internal_api/sync_manager_impl.h
@@ -115,16 +115,9 @@ class SyncManagerImpl : public SyncManager,
virtual void ShutdownOnSyncThread() OVERRIDE;
virtual UserShare* GetUserShare() OVERRIDE;
- // Update the Cryptographer from the current nigori node and write back any
- // necessary changes to the nigori node. We also detect missing encryption
- // keys and write them into the nigori node.
- // Also updates or adds the device information into the nigori node.
- // Note: opens a transaction and can trigger an ON_PASSPHRASE_REQUIRED, so
- // should only be called after syncapi is fully initialized.
- // Calls the callback argument with true if cryptographer is ready, false
- // otherwise.
- virtual void RefreshNigori(const std::string& chrome_version,
- const base::Closure& done_callback) OVERRIDE;
+ virtual void InitialProcessMetadata(
+ const std::string& chrome_version,
+ const base::Closure& done_callback) OVERRIDE;
virtual void EnableEncryptEverything() OVERRIDE;
virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE;
@@ -254,16 +247,33 @@ class SyncManagerImpl : public SyncManager,
bool existed_before,
bool exists_now);
+ // Because the session name must be fetched asynchronously,
+ // InitialProcessMetadata() is split into two parts. This is the second.
+ void InitialProcessMetadataContinuation(
+ const std::string& chrome_version,
+ const base::Closure& done_callback,
+ const std::string& session_name);
+
+ void UpdateDeviceInformation(const std::string& chrome_version,
+ const std::string& session_name);
+
// Stores the current set of encryption keys (if the cryptographer is ready)
// and encrypted types into the nigori node.
void UpdateNigoriEncryptionState(Cryptographer* cryptographer,
WriteNode* nigori_node);
- // Internal callback of UpdateCryptographerAndNigoriCallback.
- void UpdateCryptographerAndNigoriCallback(
- const std::string& chrome_version,
- const base::Closure& done_callback,
- const std::string& session_name);
+ // Updates the cryptographer from the current nigori node. Informs it of the
+ // most recent passphrase and set of encrypted types (from nigori node), then
+ // ensure all data that needs encryption is encrypted with the appropriate
+ // passphrase. Then writes this back to the ngiori node.
+ //
+ // May trigger OnPassphraseRequired(). Otherwise, it will trigger
+ // OnEncryptedTypesChanged() if necessary (see comments for
+ // OnEncryptedTypesChanged()), and then OnEncryptionComplete().
+ //
+ // Note: opens a transaction and can trigger an ON_PASSPHRASE_REQUIRED, so
+ // should only be called after syncapi is fully initialized.
+ void UpdateCryptographerAndNigori();
// Updates the nigori node with any new encrypted types and then
// encrypts the nodes for those new data types as well as other

Powered by Google App Engine
This is Rietveld 408576698