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

Side by Side Diff: components/sync/core/base_transaction.cc

Issue 2285753002: Passing correct passhprase type in the generic change processor. (Closed)
Patch Set: Created 4 years, 3 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
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 "components/sync/core/base_transaction.h" 5 #include "components/sync/core/base_transaction.h"
6 6
7 #include "components/sync/base/cryptographer.h" 7 #include "components/sync/base/cryptographer.h"
8 #include "components/sync/base/passphrase_type.h"
8 #include "components/sync/syncable/directory.h" 9 #include "components/sync/syncable/directory.h"
9 #include "components/sync/syncable/nigori_handler.h" 10 #include "components/sync/syncable/nigori_handler.h"
10 11
11 namespace syncer { 12 namespace syncer {
12 13
13 ////////////////////////////////////////////////////////////////////////// 14 //////////////////////////////////////////////////////////////////////////
14 // BaseTransaction member definitions 15 // BaseTransaction member definitions
15 BaseTransaction::BaseTransaction(UserShare* share) : user_share_(share) { 16 BaseTransaction::BaseTransaction(UserShare* share) : user_share_(share) {
16 DCHECK(share && share->directory.get()); 17 DCHECK(share && share->directory.get());
17 } 18 }
18 19
19 BaseTransaction::~BaseTransaction() {} 20 BaseTransaction::~BaseTransaction() {}
20 21
21 Cryptographer* BaseTransaction::GetCryptographer() const { 22 Cryptographer* BaseTransaction::GetCryptographer() const {
22 return GetDirectory()->GetCryptographer(this->GetWrappedTrans()); 23 return GetDirectory()->GetCryptographer(this->GetWrappedTrans());
23 } 24 }
24 25
25 ModelTypeSet BaseTransaction::GetEncryptedTypes() const { 26 ModelTypeSet BaseTransaction::GetEncryptedTypes() const {
26 syncable::NigoriHandler* nigori_handler = GetDirectory()->GetNigoriHandler(); 27 syncable::NigoriHandler* nigori_handler = GetDirectory()->GetNigoriHandler();
27 return nigori_handler 28 return nigori_handler
28 ? nigori_handler->GetEncryptedTypes(this->GetWrappedTrans()) 29 ? nigori_handler->GetEncryptedTypes(this->GetWrappedTrans())
29 : ModelTypeSet(); 30 : ModelTypeSet();
30 } 31 }
31 32
33 PassphraseType BaseTransaction::GetPassphraseType() const {
34 syncable::NigoriHandler* nigori_handler = GetDirectory()->GetNigoriHandler();
35 return nigori_handler
36 ? nigori_handler->GetPassphraseType(this->GetWrappedTrans())
37 : syncer::PassphraseType::UNDEFINED;
38 }
39
40
32 } // namespace syncer 41 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/core/base_transaction.h ('k') | components/sync/driver/generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698