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

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

Issue 10152003: sync: Make BaseNode lookup-related Init functions return specific failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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
« no previous file with comments | « chrome/browser/sync/glue/model_associator.h ('k') | chrome/browser/sync/glue/password_model_associator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/password_change_processor.cc
diff --git a/chrome/browser/sync/glue/password_change_processor.cc b/chrome/browser/sync/glue/password_change_processor.cc
index f182fb131cd64d921af9f48b07ac980ee27077e1..b4531050ab467e7977c04ab5c01e64a09e377207 100644
--- a/chrome/browser/sync/glue/password_change_processor.cc
+++ b/chrome/browser/sync/glue/password_change_processor.cc
@@ -66,7 +66,8 @@ void PasswordChangeProcessor::Observe(
sync_api::WriteTransaction trans(FROM_HERE, share_handle());
sync_api::ReadNode password_root(&trans);
- if (!password_root.InitByTagLookup(kPasswordTag)) {
+ if (password_root.InitByTagLookup(kPasswordTag) !=
+ sync_api::BaseNode::INIT_OK) {
error_handler()->OnUnrecoverableError(FROM_HERE,
"Server did not create the top-level password node. "
"We might be running against an out-of-date server.");
@@ -103,7 +104,8 @@ void PasswordChangeProcessor::Observe(
"Unable to create or retrieve password node");
return;
}
- if (!sync_node.InitByIdLookup(sync_id)) {
+ if (sync_node.InitByIdLookup(sync_id) !=
+ sync_api::BaseNode::INIT_OK) {
error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
"Unable to create or retrieve password node");
return;
@@ -120,7 +122,8 @@ void PasswordChangeProcessor::Observe(
"Unexpected notification for: ");
return;
} else {
- if (!sync_node.InitByIdLookup(sync_id)) {
+ if (sync_node.InitByIdLookup(sync_id) !=
+ sync_api::BaseNode::INIT_OK) {
error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
"Password node lookup failed.");
return;
@@ -140,7 +143,8 @@ void PasswordChangeProcessor::Observe(
LOG(WARNING) << "Trying to delete nonexistent password sync node!";
return;
} else {
- if (!sync_node.InitByIdLookup(sync_id)) {
+ if (sync_node.InitByIdLookup(sync_id) !=
+ sync_api::BaseNode::INIT_OK) {
error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
"Password node lookup failed.");
return;
@@ -162,7 +166,8 @@ void PasswordChangeProcessor::ApplyChangesFromSyncModel(
return;
sync_api::ReadNode password_root(trans);
- if (!password_root.InitByTagLookup(kPasswordTag)) {
+ if (password_root.InitByTagLookup(kPasswordTag) !=
+ sync_api::BaseNode::INIT_OK) {
error_handler()->OnUnrecoverableError(FROM_HERE,
"Password root node lookup failed.");
return;
@@ -189,7 +194,7 @@ void PasswordChangeProcessor::ApplyChangesFromSyncModel(
}
sync_api::ReadNode sync_node(trans);
- if (!sync_node.InitByIdLookup(it->id)) {
+ if (sync_node.InitByIdLookup(it->id) != sync_api::BaseNode::INIT_OK) {
error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
"Password node lookup failed.");
return;
« no previous file with comments | « chrome/browser/sync/glue/model_associator.h ('k') | chrome/browser/sync/glue/password_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698