| Index: chrome/browser/sync/glue/autofill_model_associator.cc
|
| diff --git a/chrome/browser/sync/glue/autofill_model_associator.cc b/chrome/browser/sync/glue/autofill_model_associator.cc
|
| index 435cb1c736a9d391615358e5868c98070ee0116b..73cff838785233d0e30dd589a3fa620819d9acd4 100644
|
| --- a/chrome/browser/sync/glue/autofill_model_associator.cc
|
| +++ b/chrome/browser/sync/glue/autofill_model_associator.cc
|
| @@ -14,6 +14,7 @@
|
| #include "base/utf_string_conversions.h"
|
| #include "chrome/browser/autofill/autofill_profile.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/sync/api/sync_error.h"
|
| #include "chrome/browser/sync/engine/syncapi.h"
|
| #include "chrome/browser/sync/glue/autofill_change_processor.h"
|
| #include "chrome/browser/sync/glue/autofill_profile_model_associator.h"
|
| @@ -136,7 +137,7 @@ bool AutofillModelAssociator::LoadAutofillData(
|
| return true;
|
| }
|
|
|
| -bool AutofillModelAssociator::AssociateModels() {
|
| +bool AutofillModelAssociator::AssociateModels(SyncError* error) {
|
| VLOG(1) << "Associating Autofill Models";
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
|
| {
|
| @@ -149,7 +150,9 @@ bool AutofillModelAssociator::AssociateModels() {
|
| ScopedVector<AutofillProfile> profiles;
|
|
|
| if (!LoadAutofillData(&entries, &profiles.get())) {
|
| - LOG(ERROR) << "Could not get the autofill data from WebDatabase.";
|
| + error->Reset(FROM_HERE,
|
| + "Could not get the autofill data from WebDatabase.",
|
| + model_type());
|
| return false;
|
| }
|
|
|
| @@ -159,13 +162,16 @@ bool AutofillModelAssociator::AssociateModels() {
|
|
|
| sync_api::ReadNode autofill_root(&trans);
|
| if (!autofill_root.InitByTagLookup(kAutofillTag)) {
|
| - LOG(ERROR) << "Server did not create the top-level autofill node. We "
|
| - << "might be running against an out-of-date server.";
|
| + error->Reset(FROM_HERE,
|
| + "Server did not create the top-level autofill node. We "
|
| + "might be running against an out-of-date server.",
|
| + model_type());
|
| return false;
|
| }
|
|
|
| if (!TraverseAndAssociateChromeAutofillEntries(&trans, autofill_root,
|
| entries, &bundle.current_entries, &bundle.new_entries)) {
|
| + error->Reset(FROM_HERE, "Failed to associate entries.", model_type());
|
| return false;
|
| }
|
|
|
| @@ -174,6 +180,7 @@ bool AutofillModelAssociator::AssociateModels() {
|
| autofill_root,
|
| &bundle,
|
| profiles.get())) {
|
| + error->Reset(FROM_HERE, "Failed to associate sync nodes.", model_type());
|
| return false;
|
| }
|
| }
|
| @@ -184,7 +191,7 @@ bool AutofillModelAssociator::AssociateModels() {
|
| // to worry about the sync model getting out of sync, because changes are
|
| // propagated to the ChangeProcessor on this thread.
|
| if (!SaveChangesToWebData(bundle)) {
|
| - LOG(ERROR) << "Failed to update autofill entries.";
|
| + error->Reset(FROM_HERE, "Failed to update webdata.", model_type());
|
| return false;
|
| }
|
|
|
| @@ -345,7 +352,7 @@ void AutofillModelAssociator::AddNativeProfileIfNeeded(
|
| }
|
| }
|
|
|
| -bool AutofillModelAssociator::DisassociateModels() {
|
| +bool AutofillModelAssociator::DisassociateModels(SyncError* error) {
|
| id_map_.clear();
|
| id_map_inverse_.clear();
|
| return true;
|
|
|