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

Side by Side Diff: chrome/browser/sync/glue/bookmark_model_associator.cc

Issue 10553042: sync: don't make DataTypeErrorHandler inherit UnrecoverableErrorHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/glue/bookmark_model_associator.h" 5 #include "chrome/browser/sync/glue/bookmark_model_associator.h"
6 6
7 #include <stack> 7 #include <stack>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 546 }
547 547
548 sync_api::WriteTransaction trans(FROM_HERE, user_share_); 548 sync_api::WriteTransaction trans(FROM_HERE, user_share_);
549 DirtyAssociationsSyncIds::iterator iter; 549 DirtyAssociationsSyncIds::iterator iter;
550 for (iter = dirty_associations_sync_ids_.begin(); 550 for (iter = dirty_associations_sync_ids_.begin();
551 iter != dirty_associations_sync_ids_.end(); 551 iter != dirty_associations_sync_ids_.end();
552 ++iter) { 552 ++iter) {
553 int64 sync_id = *iter; 553 int64 sync_id = *iter;
554 sync_api::WriteNode sync_node(&trans); 554 sync_api::WriteNode sync_node(&trans);
555 if (sync_node.InitByIdLookup(sync_id) != sync_api::BaseNode::INIT_OK) { 555 if (sync_node.InitByIdLookup(sync_id) != sync_api::BaseNode::INIT_OK) {
556 unrecoverable_error_handler_->OnUnrecoverableError(FROM_HERE, 556 unrecoverable_error_handler_->OnSingleDatatypeUnrecoverableError(
557 FROM_HERE,
557 "Could not lookup bookmark node for ID persistence."); 558 "Could not lookup bookmark node for ID persistence.");
558 return; 559 return;
559 } 560 }
560 const BookmarkNode* node = GetChromeNodeFromSyncId(sync_id); 561 const BookmarkNode* node = GetChromeNodeFromSyncId(sync_id);
561 if (node) 562 if (node)
562 sync_node.SetExternalId(node->id()); 563 sync_node.SetExternalId(node->id());
563 else 564 else
564 NOTREACHED(); 565 NOTREACHED();
565 } 566 }
566 dirty_associations_sync_ids_.clear(); 567 dirty_associations_sync_ids_.clear();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 bool BookmarkModelAssociator::CryptoReadyIfNecessary() { 663 bool BookmarkModelAssociator::CryptoReadyIfNecessary() {
663 // We only access the cryptographer while holding a transaction. 664 // We only access the cryptographer while holding a transaction.
664 sync_api::ReadTransaction trans(FROM_HERE, user_share_); 665 sync_api::ReadTransaction trans(FROM_HERE, user_share_);
665 const syncable::ModelTypeSet encrypted_types = 666 const syncable::ModelTypeSet encrypted_types =
666 sync_api::GetEncryptedTypes(&trans); 667 sync_api::GetEncryptedTypes(&trans);
667 return !encrypted_types.Has(syncable::BOOKMARKS) || 668 return !encrypted_types.Has(syncable::BOOKMARKS) ||
668 trans.GetCryptographer()->is_ready(); 669 trans.GetCryptographer()->is_ready();
669 } 670 }
670 671
671 } // namespace browser_sync 672 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698