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

Side by Side Diff: sync/internal_api/base_transaction.cc

Issue 10844005: [Sync] Refactor GetEncryptedTypes usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Always trigger OnEncryptedTypesChanged on init 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 "sync/internal_api/public/base_transaction.h" 5 #include "sync/internal_api/public/base_transaction.h"
6 6
7 #include "sync/syncable/directory.h" 7 #include "sync/syncable/directory.h"
8 #include "sync/syncable/nigori_handler.h"
8 #include "sync/util/cryptographer.h" 9 #include "sync/util/cryptographer.h"
9 10
10 namespace syncer { 11 namespace syncer {
11 12
12 ////////////////////////////////////////////////////////////////////////// 13 //////////////////////////////////////////////////////////////////////////
13 // BaseTransaction member definitions 14 // BaseTransaction member definitions
14 BaseTransaction::BaseTransaction(UserShare* share) { 15 BaseTransaction::BaseTransaction(UserShare* share) {
15 DCHECK(share && share->directory.get()); 16 DCHECK(share && share->directory.get());
16 directory_ = share->directory.get(); 17 directory_ = share->directory.get();
17 } 18 }
18 BaseTransaction::~BaseTransaction() { 19 BaseTransaction::~BaseTransaction() {
19 } 20 }
20 21
21 Cryptographer* BaseTransaction::GetCryptographer() const { 22 Cryptographer* BaseTransaction::GetCryptographer() const {
22 return directory_->GetCryptographer(this->GetWrappedTrans()); 23 return directory_->GetCryptographer(this->GetWrappedTrans());
23 } 24 }
24 25
25 ModelTypeSet GetEncryptedTypes(const BaseTransaction* trans) { 26 ModelTypeSet BaseTransaction::GetEncryptedTypes() const {
26 return trans->GetCryptographer()->GetEncryptedTypes(); 27 return directory_->GetNigoriHandler()->GetEncryptedTypes(
28 this->GetWrappedTrans());
27 } 29 }
28 30
29 } // namespace syncer 31 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698