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

Side by Side Diff: sync/internal_api/read_transaction.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
« no previous file with comments | « sync/internal_api/read_node.cc ('k') | sync/internal_api/shared_model_type_processor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "sync/internal_api/public/read_transaction.h"
6
7 #include <stdint.h>
8
9 #include "sync/syncable/directory.h"
10 #include "sync/syncable/syncable_read_transaction.h"
11
12 namespace syncer {
13
14 //////////////////////////////////////////////////////////////////////////
15 // ReadTransaction member definitions
16 ReadTransaction::ReadTransaction(const tracked_objects::Location& from_here,
17 UserShare* share)
18 : BaseTransaction(share),
19 transaction_(NULL),
20 close_transaction_(true) {
21 transaction_ = new syncable::ReadTransaction(from_here,
22 share->directory.get());
23 }
24
25 ReadTransaction::ReadTransaction(UserShare* share,
26 syncable::BaseTransaction* trans)
27 : BaseTransaction(share),
28 transaction_(trans),
29 close_transaction_(false) {}
30
31 ReadTransaction::~ReadTransaction() {
32 if (close_transaction_) {
33 delete transaction_;
34 }
35 }
36
37 syncable::BaseTransaction* ReadTransaction::GetWrappedTrans() const {
38 return transaction_;
39 }
40
41 int64_t ReadTransaction::GetModelVersion(ModelType type) const {
42 return transaction_->directory()->GetTransactionVersion(type);
43 }
44
45 void ReadTransaction::GetDataTypeContext(
46 ModelType type,
47 sync_pb::DataTypeContext* context) const {
48 return transaction_->directory()->GetDataTypeContext(
49 transaction_, type, context);
50 }
51
52 void ReadTransaction::GetAttachmentIdsToUpload(ModelType type,
53 AttachmentIdList* ids) const {
54 DCHECK(ids);
55 transaction_->directory()->GetAttachmentIdsToUpload(transaction_, type, ids);
56 }
57
58 std::string ReadTransaction::GetStoreBirthday() const {
59 return transaction_->directory()->store_birthday();
60 }
61
62 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/read_node.cc ('k') | sync/internal_api/shared_model_type_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698