Chromium Code Reviews| Index: chrome/browser/password_manager/password_syncable_service.h |
| diff --git a/chrome/browser/password_manager/password_syncable_service.h b/chrome/browser/password_manager/password_syncable_service.h |
| index dd32b2c323ab774c14fe583990b7c3724055809e..0caa24538fce4ab4707a040a8dfd31e5abd8577d 100644 |
| --- a/chrome/browser/password_manager/password_syncable_service.h |
| +++ b/chrome/browser/password_manager/password_syncable_service.h |
| @@ -60,15 +60,38 @@ class PasswordSyncableService : public syncer::SyncableService { |
| const std::string& password_element, |
| const std::string& signon_realm); |
| + // Converts the |password| into a SyncData object. |
| + static syncer::SyncData CreateSyncData( |
| + const autofill::PasswordForm& password); |
|
Ilya Sherman
2013/11/02 02:05:00
nit: Please leave a blank line between function de
|
| + static void ExtractPasswordFromSpecifics( |
| + const sync_pb::PasswordSpecificsData& password, |
| + autofill::PasswordForm* new_password); |
| + |
| private: |
| typedef std::vector<autofill::PasswordForm*> PasswordForms; |
| + typedef std::map<std::string, |
| + std::vector<autofill::PasswordForm*>::iterator> |
| + PasswordEntryMap; |
|
Nicolas Zea
2013/11/01 21:45:34
I just realized this contains iterators to another
|
| // Use the |PasswordStore| APIs to add and update entries. |
| - void WriteToPasswordStore(PasswordForms* new_entries, |
| - PasswordForms* udpated_entries); |
| - |
| - // Converts the |PasswordForm| to |SyncData| suitable for syncing. |
| - syncer::SyncData CreateSyncData(const autofill::PasswordForm& password); |
| + void WriteToPasswordStore(const PasswordForms& new_entries, |
| + const PasswordForms& updated_entries); |
| + |
| + // Checks if |data|, the entry in sync db, needs to be created or updated |
| + // in the passwords db. Depending on what action needs to be performed the |
| + // entry is added to |new_entries| or |updated_entries|. If the item is |
| + // identical to an entry in passwords db no action is performed. If an |
| + // item needs to be updated in the sync database then the item is also |
| + // added to |updated_db_entries| list. |
| + void CreateOrUpdateEntry( |
| + const syncer::SyncData& data, |
| + PasswordEntryMap* loaded_data, |
| + ScopedVector<autofill::PasswordForm>* new_entries, |
| + ScopedVector<autofill::PasswordForm>* updated_entries, |
| + syncer::SyncChangeList* updated_db_entries); |
| + |
| + // Virtual so tests can override. |
| + virtual void NotifyPasswordStore(); |
| // The factory that creates sync errors. |SyncError| has rich data |
| // suitable for debugging. |