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..185087a24825253a785fd637eb51c521a2df1312 100644 |
--- a/chrome/browser/password_manager/password_syncable_service.h |
+++ b/chrome/browser/password_manager/password_syncable_service.h |
@@ -60,15 +60,37 @@ 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/05 08:39:21
Why is this public? If it's just for testing, ple
lipalani1
2013/11/19 00:46:54
Done.
|
+ static void ExtractPasswordFromSpecifics( |
+ const sync_pb::PasswordSpecificsData& password, |
+ autofill::PasswordForm* new_password); |
Ilya Sherman
2013/11/05 08:39:21
Why is this public?
lipalani1
2013/11/19 00:46:54
made it private.
On 2013/11/05 08:39:21, Ilya Sher
|
+ |
private: |
typedef std::vector<autofill::PasswordForm*> PasswordForms; |
+ typedef std::map<std::string, autofill::PasswordForm*> |
+ PasswordEntryMap; |
// 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 |
Ilya Sherman
2013/11/05 08:39:21
nit: "db" -> "database" (throughout)
lipalani1
2013/11/19 00:46:54
I borrowed the abbreviation db from db thread. So
Ilya Sherman
2013/11/19 22:49:03
I won't block the review on this, but I do think t
|
+ // 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 |
Ilya Sherman
2013/11/05 08:39:21
nit: "an entry in passwords db no action" -> "an e
lipalani1
2013/11/19 00:46:54
Done.
|
+ // item needs to be updated in the sync database then the item is also |
+ // added to |updated_db_entries| list. |
Ilya Sherman
2013/11/05 08:39:21
Please document that this method has a side-effect
lipalani1
2013/11/19 00:46:54
Done.
|
+ void CreateOrUpdateEntry( |
+ const syncer::SyncData& data, |
+ PasswordEntryMap* loaded_data, |
+ ScopedVector<autofill::PasswordForm>* new_entries, |
+ ScopedVector<autofill::PasswordForm>* updated_entries, |
+ syncer::SyncChangeList* updated_db_entries); |
Ilya Sherman
2013/11/05 08:39:21
nit: "db" -> "database" in variable names as well.
lipalani1
2013/11/19 00:46:54
Done.
|
+ |
+ // Virtual so tests can override. |
Ilya Sherman
2013/11/05 08:39:21
Please document what this method does.
Ilya Sherman
2013/11/05 08:39:21
Subclasses should not override private methods...
lipalani1
2013/11/19 00:46:54
Done.
lipalani1
2013/11/19 00:46:54
Done.
|
+ virtual void NotifyPasswordStore(); |
Ilya Sherman
2013/11/05 08:39:21
This method name is somewhat unclear -- what is th
lipalani1
2013/11/19 00:46:54
Done.
|
// The factory that creates sync errors. |SyncError| has rich data |
// suitable for debugging. |