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 "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/syncable/nigori_handler.h" |
9 #include "sync/util/cryptographer.h" | 9 #include "sync/util/cryptographer.h" |
10 | 10 |
11 namespace syncer { | 11 namespace syncer { |
12 | 12 |
13 ////////////////////////////////////////////////////////////////////////// | 13 ////////////////////////////////////////////////////////////////////////// |
14 // BaseTransaction member definitions | 14 // BaseTransaction member definitions |
15 BaseTransaction::BaseTransaction(UserShare* share) { | 15 BaseTransaction::BaseTransaction(UserShare* share) |
| 16 : user_share_(share) { |
16 DCHECK(share && share->directory.get()); | 17 DCHECK(share && share->directory.get()); |
17 directory_ = share->directory.get(); | |
18 } | 18 } |
| 19 |
19 BaseTransaction::~BaseTransaction() { | 20 BaseTransaction::~BaseTransaction() { |
20 } | 21 } |
21 | 22 |
22 Cryptographer* BaseTransaction::GetCryptographer() const { | 23 Cryptographer* BaseTransaction::GetCryptographer() const { |
23 return directory_->GetCryptographer(this->GetWrappedTrans()); | 24 return GetDirectory()->GetCryptographer(this->GetWrappedTrans()); |
24 } | 25 } |
25 | 26 |
26 ModelTypeSet BaseTransaction::GetEncryptedTypes() const { | 27 ModelTypeSet BaseTransaction::GetEncryptedTypes() const { |
27 return directory_->GetNigoriHandler()->GetEncryptedTypes( | 28 return GetDirectory()->GetNigoriHandler()->GetEncryptedTypes( |
28 this->GetWrappedTrans()); | 29 this->GetWrappedTrans()); |
29 } | 30 } |
30 | 31 |
31 } // namespace syncer | 32 } // namespace syncer |
OLD | NEW |