Chromium Code Reviews| Index: chrome/browser/extensions/api/storage/syncable_settings_storage.h |
| diff --git a/chrome/browser/extensions/api/storage/syncable_settings_storage.h b/chrome/browser/extensions/api/storage/syncable_settings_storage.h |
| index a5fb15047ce1f15f612afa7829db0d3922b69e69..5b9cf8352a2f524b4fe12e85c42d7f906664d9a5 100644 |
| --- a/chrome/browser/extensions/api/storage/syncable_settings_storage.h |
| +++ b/chrome/browser/extensions/api/storage/syncable_settings_storage.h |
| @@ -55,29 +55,43 @@ class SyncableSettingsStorage : public ValueStore { |
| // ExtensionSettings), but with looser guarantees about when the methods |
| // can be called. |
| - // Must only be called if sync isn't already active. |
| + // Starts syncing this storage area. Must only be called if sync isn't |
| + // already active. |
| + // |sync_state| is the current state of the extension settings in sync. |
| + // |sync_processor| is used to write out any changes. |
| + // Returns any error when trying to sync, or an empty error on success. |
| syncer::SyncError StartSyncing( |
| - const base::DictionaryValue& sync_state, |
| + scoped_ptr<base::DictionaryValue> sync_state, |
| scoped_ptr<SettingsSyncProcessor> sync_processor); |
| - // May be called at any time (idempotent). |
| + // Stops syncing this storage area. May be called at any time (idempotent). |
| void StopSyncing(); |
| - // May be called at any time; changes will be ignored if sync isn't active. |
| - syncer::SyncError ProcessSyncChanges(const SettingSyncDataList& sync_changes); |
| + // Pushes a list of sync changes into this storage area. May be called at |
| + // any time, changes will be ignored if sync isn't active. |
| + // |sync_changes| are the changes to push. |
| + // Returns any error when trying to sync, or an empty error on success. |
| + syncer::SyncError ProcessSyncChanges( |
| + scoped_ptr<SettingSyncDataList> sync_changes); |
| private: |
| // Sends the changes from |result| to sync if it's enabled. |
| void SyncResultIfEnabled(const ValueStore::WriteResult& result); |
| - // Sends all local settings to sync (synced settings assumed to be empty). |
| + // Sends all local settings to sync. This assumes that there are no settings |
| + // in sync yet. |
| + // |local_state| the local storage state. |
|
Devlin
2015/05/15 21:59:08
nitty nit: missing an is, here. That said, I don'
not at google - send to devlin
2015/05/15 23:28:30
well, sometimes comments on parameters are good, r
|
| + // Returns any error when trying to sync, or an empty error on success. |
| syncer::SyncError SendLocalSettingsToSync( |
| - const base::DictionaryValue& settings); |
| + scoped_ptr<base::DictionaryValue> local_state); |
| // Overwrites local state with sync state. |
| + // |local_state| the local storage state. Will be overwritten by |sync_state|. |
|
Devlin
2015/05/15 21:59:08
nit: Also missing "is"s here (|local_state| _is_..
not at google - send to devlin
2015/05/15 23:28:30
Done.
|
| + // |sync_state| the storage state from sync. Will write over |local_state|. |
| + // Returns any error when trying to sync, or an empty error on success. |
| syncer::SyncError OverwriteLocalSettingsWithSync( |
| - const base::DictionaryValue& sync_state, |
| - const base::DictionaryValue& settings); |
| + scoped_ptr<base::DictionaryValue> sync_state, |
| + scoped_ptr<base::DictionaryValue> local_state); |
| // Called when an Add/Update/Remove comes from sync. Ownership of Value*s |
| // are taken. |