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

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

Issue 8851006: [Sync] Replace all instances of ModelTypeSet with ModelEnumSet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup pass #2 Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 // same as number of nodes in the sync model. This can happen when the sync 609 // same as number of nodes in the sync model. This can happen when the sync
610 // model doesn't get a chance to persist its changes, for example when 610 // model doesn't get a chance to persist its changes, for example when
611 // Chrome does not shut down gracefully. In such cases we can't trust the 611 // Chrome does not shut down gracefully. In such cases we can't trust the
612 // loaded associations. 612 // loaded associations.
613 return sync_node_count == id_index.count(); 613 return sync_node_count == id_index.count();
614 } 614 }
615 615
616 bool BookmarkModelAssociator::CryptoReadyIfNecessary() { 616 bool BookmarkModelAssociator::CryptoReadyIfNecessary() {
617 // We only access the cryptographer while holding a transaction. 617 // We only access the cryptographer while holding a transaction.
618 sync_api::ReadTransaction trans(FROM_HERE, user_share_); 618 sync_api::ReadTransaction trans(FROM_HERE, user_share_);
619 const syncable::ModelTypeSet& encrypted_types = 619 const syncable::ModelEnumSet encrypted_types =
620 sync_api::GetEncryptedTypes(&trans); 620 sync_api::GetEncryptedTypes(&trans);
621 return encrypted_types.count(syncable::BOOKMARKS) == 0 || 621 return !encrypted_types.Has(syncable::BOOKMARKS) ||
622 trans.GetCryptographer()->is_ready(); 622 trans.GetCryptographer()->is_ready();
623 } 623 }
624 624
625 } // namespace browser_sync 625 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/failed_datatypes_handler.cc ('k') | chrome/browser/sync/glue/data_type_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698