| 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/read_transaction.h" | 5 #include "sync/internal_api/public/read_transaction.h" |
| 6 | 6 |
| 7 #include "sync/syncable/read_transaction.h" | 7 #include "sync/syncable/read_transaction.h" |
| 8 | 8 |
| 9 namespace csync { | 9 namespace syncer { |
| 10 | 10 |
| 11 ////////////////////////////////////////////////////////////////////////// | 11 ////////////////////////////////////////////////////////////////////////// |
| 12 // ReadTransaction member definitions | 12 // ReadTransaction member definitions |
| 13 ReadTransaction::ReadTransaction(const tracked_objects::Location& from_here, | 13 ReadTransaction::ReadTransaction(const tracked_objects::Location& from_here, |
| 14 UserShare* share) | 14 UserShare* share) |
| 15 : BaseTransaction(share), | 15 : BaseTransaction(share), |
| 16 transaction_(NULL), | 16 transaction_(NULL), |
| 17 close_transaction_(true) { | 17 close_transaction_(true) { |
| 18 transaction_ = new syncable::ReadTransaction(from_here, | 18 transaction_ = new syncable::ReadTransaction(from_here, |
| 19 share->directory.get()); | 19 share->directory.get()); |
| 20 } | 20 } |
| 21 | 21 |
| 22 ReadTransaction::ReadTransaction(UserShare* share, | 22 ReadTransaction::ReadTransaction(UserShare* share, |
| 23 syncable::BaseTransaction* trans) | 23 syncable::BaseTransaction* trans) |
| 24 : BaseTransaction(share), | 24 : BaseTransaction(share), |
| 25 transaction_(trans), | 25 transaction_(trans), |
| 26 close_transaction_(false) {} | 26 close_transaction_(false) {} |
| 27 | 27 |
| 28 ReadTransaction::~ReadTransaction() { | 28 ReadTransaction::~ReadTransaction() { |
| 29 if (close_transaction_) { | 29 if (close_transaction_) { |
| 30 delete transaction_; | 30 delete transaction_; |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 | 33 |
| 34 syncable::BaseTransaction* ReadTransaction::GetWrappedTrans() const { | 34 syncable::BaseTransaction* ReadTransaction::GetWrappedTrans() const { |
| 35 return transaction_; | 35 return transaction_; |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace csync | 38 } // namespace syncer |
| OLD | NEW |