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

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

Issue 7497014: Revert 94128 - [Sync] Refactor sync datatype error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « chrome/browser/sync/glue/bookmark_model_associator.h ('k') | chrome/browser/sync/glue/data_type_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/bookmark_model_associator.cc
===================================================================
--- chrome/browser/sync/glue/bookmark_model_associator.cc (revision 94142)
+++ chrome/browser/sync/glue/bookmark_model_associator.cc (working copy)
@@ -14,7 +14,6 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.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/bookmark_change_processor.h"
#include "chrome/browser/sync/syncable/nigori_util.h"
@@ -45,9 +44,6 @@
static const char kBookmarkBarTag[] = "bookmark_bar";
static const char kSyncedBookmarksTag[] = "synced_bookmarks";
static const char kOtherBookmarksTag[] = "other_bookmarks";
-static const char kServerError[] =
- "Server did not create top-level nodes. Possibly we are running against "
- "an out-of-date server?";
// Bookmark comparer for map of bookmark nodes.
class BookmarkComparer {
@@ -182,7 +178,7 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
-bool BookmarkModelAssociator::DisassociateModels(SyncError* error) {
+bool BookmarkModelAssociator::DisassociateModels() {
id_map_.clear();
id_map_inverse_.clear();
dirty_associations_sync_ids_.clear();
@@ -319,20 +315,20 @@
return true;
}
-bool BookmarkModelAssociator::AssociateModels(SyncError* error) {
+bool BookmarkModelAssociator::AssociateModels() {
// Try to load model associations from persisted associations first. If that
// succeeds, we don't need to run the complex model matching algorithm.
if (LoadAssociations())
return true;
- DisassociateModels(error);
+ DisassociateModels();
// We couldn't load model associations from persisted associations. So build
// them.
- return BuildAssociations(error);
+ return BuildAssociations();
}
-bool BookmarkModelAssociator::BuildAssociations(SyncError* error) {
+bool BookmarkModelAssociator::BuildAssociations() {
// Algorithm description:
// Match up the roots and recursively do the following:
// * For each sync node for the current sync parent node, find the best
@@ -356,12 +352,14 @@
// and Other Bookmarks.
if (!AssociateTaggedPermanentNode(bookmark_model_->other_node(),
kOtherBookmarksTag)) {
- error->Reset(FROM_HERE, kServerError, model_type());
+ LOG(ERROR) << "Server did not create top-level nodes. Possibly we "
+ << "are running against an out-of-date server?";
return false;
}
if (!AssociateTaggedPermanentNode(bookmark_model_->bookmark_bar_node(),
kBookmarkBarTag)) {
- error->Reset(FROM_HERE, kServerError, model_type());
+ LOG(ERROR) << "Server did not create top-level nodes. Possibly we "
+ << "are running against an out-of-date server?";
return false;
}
if (!AssociateTaggedPermanentNode(bookmark_model_->synced_node(),
@@ -370,7 +368,8 @@
// server if the command line flag is set.
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableSyncedBookmarksFolder)) {
- error->Reset(FROM_HERE, kServerError, model_type());
+ LOG(ERROR) << "Server did not create top-level synced nodes. Possibly "
+ << "we are running against an out-of-date server?";
return false;
}
int64 bookmark_bar_sync_id = GetSyncIdFromChromeId(
@@ -400,7 +399,6 @@
sync_api::ReadNode sync_parent(&trans);
if (!sync_parent.InitByIdLookup(sync_parent_id)) {
- error->Reset(FROM_HERE, "Failed to lookup node.", model_type());
return false;
}
// Only folder nodes are pushed on to the stack.
@@ -416,7 +414,6 @@
while (sync_child_id != sync_api::kInvalidId) {
sync_api::WriteNode sync_child_node(&trans);
if (!sync_child_node.InitByIdLookup(sync_child_id)) {
- error->Reset(FROM_HERE, "Failed to lookup node.", model_type());
return false;
}
« no previous file with comments | « chrome/browser/sync/glue/bookmark_model_associator.h ('k') | chrome/browser/sync/glue/data_type_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698