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

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

Issue 10844005: [Sync] Refactor GetEncryptedTypes usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + add dcheck Created 8 years, 4 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 // same as number of nodes in the sync model. This can happen when the sync 657 // same as number of nodes in the sync model. This can happen when the sync
658 // model doesn't get a chance to persist its changes, for example when 658 // model doesn't get a chance to persist its changes, for example when
659 // Chrome does not shut down gracefully. In such cases we can't trust the 659 // Chrome does not shut down gracefully. In such cases we can't trust the
660 // loaded associations. 660 // loaded associations.
661 return sync_node_count == id_index.count(); 661 return sync_node_count == id_index.count();
662 } 662 }
663 663
664 bool BookmarkModelAssociator::CryptoReadyIfNecessary() { 664 bool BookmarkModelAssociator::CryptoReadyIfNecessary() {
665 // We only access the cryptographer while holding a transaction. 665 // We only access the cryptographer while holding a transaction.
666 syncer::ReadTransaction trans(FROM_HERE, user_share_); 666 syncer::ReadTransaction trans(FROM_HERE, user_share_);
667 const syncer::ModelTypeSet encrypted_types = 667 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes();
668 syncer::GetEncryptedTypes(&trans);
669 return !encrypted_types.Has(syncer::BOOKMARKS) || 668 return !encrypted_types.Has(syncer::BOOKMARKS) ||
670 trans.GetCryptographer()->is_ready(); 669 trans.GetCryptographer()->is_ready();
671 } 670 }
672 671
673 } // namespace browser_sync 672 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/bookmark_change_processor.cc ('k') | chrome/browser/sync/glue/generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698