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

Unified Diff: chrome/browser/sync/glue/autofill_model_associator.cc

Issue 7461098: Reland 87645 with clang fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 5 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: 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;
« no previous file with comments | « chrome/browser/sync/glue/autofill_model_associator.h ('k') | chrome/browser/sync/glue/autofill_profile_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698