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

Side by Side Diff: components/sync/core/read_transaction.cc

Issue 2407163004: [Sync] Move some directory-related things from core/ to syncable/. (Closed)
Patch Set: Created 4 years, 2 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 | « components/sync/core/read_transaction.h ('k') | components/sync/core/sync_manager.h » ('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 "components/sync/core/read_transaction.h"
6
7 #include "components/sync/syncable/directory.h"
8 #include "components/sync/syncable/syncable_read_transaction.h"
9
10 namespace syncer {
11
12 //////////////////////////////////////////////////////////////////////////
13 // ReadTransaction member definitions
14 ReadTransaction::ReadTransaction(const tracked_objects::Location& from_here,
15 UserShare* share)
16 : BaseTransaction(share), transaction_(NULL), close_transaction_(true) {
17 transaction_ =
18 new syncable::ReadTransaction(from_here, share->directory.get());
19 }
20
21 ReadTransaction::ReadTransaction(UserShare* share,
22 syncable::BaseTransaction* trans)
23 : BaseTransaction(share), transaction_(trans), close_transaction_(false) {}
24
25 ReadTransaction::~ReadTransaction() {
26 if (close_transaction_) {
27 delete transaction_;
28 }
29 }
30
31 syncable::BaseTransaction* ReadTransaction::GetWrappedTrans() const {
32 return transaction_;
33 }
34
35 int64_t ReadTransaction::GetModelVersion(ModelType type) const {
36 return transaction_->directory()->GetTransactionVersion(type);
37 }
38
39 void ReadTransaction::GetDataTypeContext(
40 ModelType type,
41 sync_pb::DataTypeContext* context) const {
42 return transaction_->directory()->GetDataTypeContext(transaction_, type,
43 context);
44 }
45
46 void ReadTransaction::GetAttachmentIdsToUpload(ModelType type,
47 AttachmentIdList* ids) const {
48 DCHECK(ids);
49 transaction_->directory()->GetAttachmentIdsToUpload(transaction_, type, ids);
50 }
51
52 std::string ReadTransaction::GetStoreBirthday() const {
53 return transaction_->directory()->store_birthday();
54 }
55
56 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/core/read_transaction.h ('k') | components/sync/core/sync_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698