| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/sync/internal_api/read_transaction.h" |
| 6 |
| 7 #include "chrome/browser/sync/syncable/syncable.h" |
| 8 |
| 9 namespace sync_api { |
| 10 |
| 11 ////////////////////////////////////////////////////////////////////////// |
| 12 // ReadTransaction member definitions |
| 13 ReadTransaction::ReadTransaction(const tracked_objects::Location& from_here, |
| 14 UserShare* share) |
| 15 : BaseTransaction(share), |
| 16 transaction_(NULL), |
| 17 close_transaction_(true) { |
| 18 transaction_ = new syncable::ReadTransaction(from_here, GetLookup()); |
| 19 } |
| 20 |
| 21 ReadTransaction::ReadTransaction(UserShare* share, |
| 22 syncable::BaseTransaction* trans) |
| 23 : BaseTransaction(share), |
| 24 transaction_(trans), |
| 25 close_transaction_(false) {} |
| 26 |
| 27 ReadTransaction::~ReadTransaction() { |
| 28 if (close_transaction_) { |
| 29 delete transaction_; |
| 30 } |
| 31 } |
| 32 |
| 33 syncable::BaseTransaction* ReadTransaction::GetWrappedTrans() const { |
| 34 return transaction_; |
| 35 } |
| 36 |
| 37 } // namespace sync_api |
| OLD | NEW |