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

Unified Diff: chrome/browser/sync/glue/theme_model_associator.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
Index: chrome/browser/sync/glue/theme_model_associator.cc
diff --git a/chrome/browser/sync/glue/theme_model_associator.cc b/chrome/browser/sync/glue/theme_model_associator.cc
index 5521de4c671881becf62638e17c3aa6fc2ab01fd..f48a8296e297c77958b85264b453191b35e771f3 100644
--- a/chrome/browser/sync/glue/theme_model_associator.cc
+++ b/chrome/browser/sync/glue/theme_model_associator.cc
@@ -44,7 +44,7 @@ ThemeModelAssociator::~ThemeModelAssociator() {}
SyncError ThemeModelAssociator::AssociateModels() {
sync_api::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare());
sync_api::ReadNode root(&trans);
- if (!root.InitByTagLookup(kThemesTag)) {
+ if (root.InitByTagLookup(kThemesTag) != sync_api::BaseNode::INIT_OK) {
return error_handler_->CreateAndUploadError(FROM_HERE,
kNoThemesFolderError,
model_type());
@@ -55,7 +55,8 @@ SyncError ThemeModelAssociator::AssociateModels() {
// TODO(akalin): When we have timestamps, we may want to do
// something more intelligent than preferring the sync data over our
// local data.
- if (node.InitByClientTagLookup(syncable::THEMES, kCurrentThemeClientTag)) {
+ if (node.InitByClientTagLookup(syncable::THEMES, kCurrentThemeClientTag) ==
+ sync_api::BaseNode::INIT_OK) {
// Update the current theme from the sync data.
// TODO(akalin): If the sync data does not have
// use_system_theme_by_default and we do, update that flag on the
@@ -93,7 +94,7 @@ bool ThemeModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) {
*has_nodes = false;
sync_api::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare());
sync_api::ReadNode root(&trans);
- if (!root.InitByTagLookup(kThemesTag)) {
+ if (root.InitByTagLookup(kThemesTag) != sync_api::BaseNode::INIT_OK) {
LOG(ERROR) << kNoThemesFolderError;
return false;
}
« no previous file with comments | « chrome/browser/sync/glue/theme_change_processor.cc ('k') | chrome/browser/sync/glue/typed_url_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698