| OLD | NEW |
| 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 // same as number of nodes in the sync model. This can happen when the sync | 656 // same as number of nodes in the sync model. This can happen when the sync |
| 657 // model doesn't get a chance to persist its changes, for example when | 657 // model doesn't get a chance to persist its changes, for example when |
| 658 // Chrome does not shut down gracefully. In such cases we can't trust the | 658 // Chrome does not shut down gracefully. In such cases we can't trust the |
| 659 // loaded associations. | 659 // loaded associations. |
| 660 return sync_node_count == id_index.count(); | 660 return sync_node_count == id_index.count(); |
| 661 } | 661 } |
| 662 | 662 |
| 663 bool BookmarkModelAssociator::CryptoReadyIfNecessary() { | 663 bool BookmarkModelAssociator::CryptoReadyIfNecessary() { |
| 664 // We only access the cryptographer while holding a transaction. | 664 // We only access the cryptographer while holding a transaction. |
| 665 syncer::ReadTransaction trans(FROM_HERE, user_share_); | 665 syncer::ReadTransaction trans(FROM_HERE, user_share_); |
| 666 const syncable::ModelTypeSet encrypted_types = | 666 const syncer::ModelTypeSet encrypted_types = |
| 667 syncer::GetEncryptedTypes(&trans); | 667 syncer::GetEncryptedTypes(&trans); |
| 668 return !encrypted_types.Has(syncable::BOOKMARKS) || | 668 return !encrypted_types.Has(syncer::BOOKMARKS) || |
| 669 trans.GetCryptographer()->is_ready(); | 669 trans.GetCryptographer()->is_ready(); |
| 670 } | 670 } |
| 671 | 671 |
| 672 } // namespace browser_sync | 672 } // namespace browser_sync |
| OLD | NEW |