Add some more state to the card unmasking prompt.
[chromium-blink-merge.git] / sync / internal_api / read_transaction.cc
blob872818fb3b4fb89723afc3aaf78adb0bdd7808b3
1 // Copyright 2012 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.
5 #include "sync/internal_api/public/read_transaction.h"
7 #include "sync/syncable/directory.h"
8 #include "sync/syncable/syncable_read_transaction.h"
10 namespace syncer {
12 //////////////////////////////////////////////////////////////////////////
13 // ReadTransaction member definitions
14 ReadTransaction::ReadTransaction(const tracked_objects::Location& from_here,
15 UserShare* share)
16 : BaseTransaction(share),
17 transaction_(NULL),
18 close_transaction_(true) {
19 transaction_ = new syncable::ReadTransaction(from_here,
20 share->directory.get());
23 ReadTransaction::ReadTransaction(UserShare* share,
24 syncable::BaseTransaction* trans)
25 : BaseTransaction(share),
26 transaction_(trans),
27 close_transaction_(false) {}
29 ReadTransaction::~ReadTransaction() {
30 if (close_transaction_) {
31 delete transaction_;
35 syncable::BaseTransaction* ReadTransaction::GetWrappedTrans() const {
36 return transaction_;
39 int64 ReadTransaction::GetModelVersion(ModelType type) const {
40 return transaction_->directory()->GetTransactionVersion(type);
43 void ReadTransaction::GetDataTypeContext(
44 ModelType type,
45 sync_pb::DataTypeContext* context) const {
46 return transaction_->directory()->GetDataTypeContext(
47 transaction_, type, context);
50 void ReadTransaction::GetAttachmentIdsToUpload(ModelType type,
51 AttachmentIdSet* id_set) const {
52 DCHECK(id_set);
53 transaction_->directory()->GetAttachmentIdsToUpload(
54 transaction_, type, id_set);
57 std::string ReadTransaction::GetStoreBirthday() const {
58 return transaction_->directory()->store_birthday();
61 } // namespace syncer