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/session_model_associator.h" | 5 #include "chrome/browser/sync/glue/session_model_associator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 MessageLoop::current()->PostDelayedTask( | 1586 MessageLoop::current()->PostDelayedTask( |
1587 FROM_HERE, | 1587 FROM_HERE, |
1588 base::Bind(&SessionModelAssociator::QuitLoopForSubtleTesting, | 1588 base::Bind(&SessionModelAssociator::QuitLoopForSubtleTesting, |
1589 test_weak_factory_.GetWeakPtr()), | 1589 test_weak_factory_.GetWeakPtr()), |
1590 timeout); | 1590 timeout); |
1591 } | 1591 } |
1592 | 1592 |
1593 bool SessionModelAssociator::CryptoReadyIfNecessary() { | 1593 bool SessionModelAssociator::CryptoReadyIfNecessary() { |
1594 // We only access the cryptographer while holding a transaction. | 1594 // We only access the cryptographer while holding a transaction. |
1595 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 1595 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
1596 const syncer::ModelTypeSet encrypted_types = | 1596 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); |
1597 syncer::GetEncryptedTypes(&trans); | |
1598 return !encrypted_types.Has(SESSIONS) || | 1597 return !encrypted_types.Has(SESSIONS) || |
1599 sync_service_->IsCryptographerReady(&trans); | 1598 sync_service_->IsCryptographerReady(&trans); |
1600 } | 1599 } |
1601 | 1600 |
1602 } // namespace browser_sync | 1601 } // namespace browser_sync |
OLD | NEW |