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

Side by Side Diff: chrome/browser/sync/glue/session_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/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 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 MessageLoop::current()->PostDelayedTask( 1588 MessageLoop::current()->PostDelayedTask(
1589 FROM_HERE, 1589 FROM_HERE,
1590 base::Bind(&SessionModelAssociator::QuitLoopForSubtleTesting, 1590 base::Bind(&SessionModelAssociator::QuitLoopForSubtleTesting,
1591 test_weak_factory_.GetWeakPtr()), 1591 test_weak_factory_.GetWeakPtr()),
1592 timeout); 1592 timeout);
1593 } 1593 }
1594 1594
1595 bool SessionModelAssociator::CryptoReadyIfNecessary() { 1595 bool SessionModelAssociator::CryptoReadyIfNecessary() {
1596 // We only access the cryptographer while holding a transaction. 1596 // We only access the cryptographer while holding a transaction.
1597 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); 1597 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare());
1598 const syncer::ModelTypeSet encrypted_types = 1598 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes();
1599 syncer::GetEncryptedTypes(&trans);
1600 return !encrypted_types.Has(SESSIONS) || 1599 return !encrypted_types.Has(SESSIONS) ||
1601 sync_service_->IsCryptographerReady(&trans); 1600 sync_service_->IsCryptographerReady(&trans);
1602 } 1601 }
1603 1602
1604 } // namespace browser_sync 1603 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/generic_change_processor.cc ('k') | chrome/browser/sync/glue/theme_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698