OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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/write_transaction.h" | 5 #include "sync/internal_api/public/write_transaction.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "sync/syncable/directory.h" | 9 #include "sync/syncable/directory.h" |
8 #include "sync/syncable/mutable_entry.h" | 10 #include "sync/syncable/mutable_entry.h" |
9 #include "sync/syncable/syncable_write_transaction.h" | 11 #include "sync/syncable/syncable_write_transaction.h" |
10 | 12 |
11 namespace syncer { | 13 namespace syncer { |
12 | 14 |
13 ////////////////////////////////////////////////////////////////////////// | 15 ////////////////////////////////////////////////////////////////////////// |
14 // WriteTransaction member definitions | 16 // WriteTransaction member definitions |
15 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, | 17 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, |
16 UserShare* share) | 18 UserShare* share) |
17 : BaseTransaction(share), | 19 : BaseTransaction(share), |
18 transaction_(NULL) { | 20 transaction_(NULL) { |
19 transaction_ = new syncable::WriteTransaction(from_here, syncable::SYNCAPI, | 21 transaction_ = new syncable::WriteTransaction(from_here, syncable::SYNCAPI, |
20 share->directory.get()); | 22 share->directory.get()); |
21 } | 23 } |
22 | 24 |
23 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, | 25 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, |
24 UserShare* share, | 26 UserShare* share, |
25 int64* new_model_version) | 27 int64_t* new_model_version) |
26 : BaseTransaction(share), | 28 : BaseTransaction(share), transaction_(NULL) { |
27 transaction_(NULL) { | |
28 transaction_ = new syncable::WriteTransaction(from_here, | 29 transaction_ = new syncable::WriteTransaction(from_here, |
29 share->directory.get(), | 30 share->directory.get(), |
30 new_model_version); | 31 new_model_version); |
31 } | 32 } |
32 | 33 |
33 WriteTransaction::~WriteTransaction() { | 34 WriteTransaction::~WriteTransaction() { |
34 delete transaction_; | 35 delete transaction_; |
35 } | 36 } |
36 | 37 |
37 syncable::BaseTransaction* WriteTransaction::GetWrappedTrans() const { | 38 syncable::BaseTransaction* WriteTransaction::GetWrappedTrans() const { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 transaction_, attachment_id.GetProto(), &handles); | 89 transaction_, attachment_id.GetProto(), &handles); |
89 for (syncable::Directory::Metahandles::iterator iter = handles.begin(); | 90 for (syncable::Directory::Metahandles::iterator iter = handles.begin(); |
90 iter != handles.end(); | 91 iter != handles.end(); |
91 ++iter) { | 92 ++iter) { |
92 syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter); | 93 syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter); |
93 entry.MarkAttachmentAsOnServer(attachment_id.GetProto()); | 94 entry.MarkAttachmentAsOnServer(attachment_id.GetProto()); |
94 } | 95 } |
95 } | 96 } |
96 | 97 |
97 } // namespace syncer | 98 } // namespace syncer |
OLD | NEW |