| 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 "components/sync/syncable/write_transaction.h" | 5 #include "components/sync/syncable/write_transaction.h" |
| 6 | 6 |
| 7 #include "components/sync/syncable/directory.h" | 7 #include "components/sync/syncable/directory.h" |
| 8 #include "components/sync/syncable/mutable_entry.h" | 8 #include "components/sync/syncable/mutable_entry.h" |
| 9 #include "components/sync/syncable/syncable_write_transaction.h" | 9 #include "components/sync/syncable/syncable_write_transaction.h" |
| 10 | 10 |
| 11 namespace syncer { | 11 namespace syncer { |
| 12 | 12 |
| 13 ////////////////////////////////////////////////////////////////////////// | 13 ////////////////////////////////////////////////////////////////////////// |
| 14 // WriteTransaction member definitions | 14 // WriteTransaction member definitions |
| 15 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, | 15 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, |
| 16 UserShare* share) | 16 UserShare* share) |
| 17 : BaseTransaction(share), transaction_(NULL) { | 17 : BaseTransaction(share), transaction_(nullptr) { |
| 18 transaction_ = new syncable::WriteTransaction(from_here, syncable::SYNCAPI, | 18 transaction_ = new syncable::WriteTransaction(from_here, syncable::SYNCAPI, |
| 19 share->directory.get()); | 19 share->directory.get()); |
| 20 } | 20 } |
| 21 | 21 |
| 22 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, | 22 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, |
| 23 UserShare* share, | 23 UserShare* share, |
| 24 int64_t* new_model_version) | 24 int64_t* new_model_version) |
| 25 : BaseTransaction(share), transaction_(NULL) { | 25 : BaseTransaction(share), transaction_(nullptr) { |
| 26 transaction_ = new syncable::WriteTransaction( | 26 transaction_ = new syncable::WriteTransaction( |
| 27 from_here, share->directory.get(), new_model_version); | 27 from_here, share->directory.get(), new_model_version); |
| 28 } | 28 } |
| 29 | 29 |
| 30 WriteTransaction::~WriteTransaction() { | 30 WriteTransaction::~WriteTransaction() { |
| 31 delete transaction_; | 31 delete transaction_; |
| 32 } | 32 } |
| 33 | 33 |
| 34 syncable::BaseTransaction* WriteTransaction::GetWrappedTrans() const { | 34 syncable::BaseTransaction* WriteTransaction::GetWrappedTrans() const { |
| 35 return transaction_; | 35 return transaction_; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 GetDirectory()->GetMetahandlesByAttachmentId( | 80 GetDirectory()->GetMetahandlesByAttachmentId( |
| 81 transaction_, attachment_id.GetProto(), &handles); | 81 transaction_, attachment_id.GetProto(), &handles); |
| 82 for (syncable::Directory::Metahandles::iterator iter = handles.begin(); | 82 for (syncable::Directory::Metahandles::iterator iter = handles.begin(); |
| 83 iter != handles.end(); ++iter) { | 83 iter != handles.end(); ++iter) { |
| 84 syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter); | 84 syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter); |
| 85 entry.MarkAttachmentAsOnServer(attachment_id.GetProto()); | 85 entry.MarkAttachmentAsOnServer(attachment_id.GetProto()); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace syncer | 89 } // namespace syncer |
| OLD | NEW |