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 "sync/syncable/directory.h" | 7 #include "sync/syncable/directory.h" |
8 #include "sync/syncable/mutable_entry.h" | 8 #include "sync/syncable/mutable_entry.h" |
9 #include "sync/syncable/syncable_write_transaction.h" | 9 #include "sync/syncable/syncable_write_transaction.h" |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // data type. | 74 // data type. |
75 GetDirectory()->ResetVersionsForType(transaction_, type); | 75 GetDirectory()->ResetVersionsForType(transaction_, type); |
76 } | 76 } |
77 | 77 |
78 // Note that it's possible for a GetUpdatesResponse that arrives immediately | 78 // Note that it's possible for a GetUpdatesResponse that arrives immediately |
79 // after the context update to override the cleared progress markers. | 79 // after the context update to override the cleared progress markers. |
80 // TODO(zea): add a flag in the directory to prevent this from happening. | 80 // TODO(zea): add a flag in the directory to prevent this from happening. |
81 // See crbug.com/360280 | 81 // See crbug.com/360280 |
82 } | 82 } |
83 | 83 |
84 void WriteTransaction::UpdateEntriesWithAttachmentId( | 84 void WriteTransaction::UpdateEntriesMarkAttachmentAsOnServer( |
85 const AttachmentId& attachment_id) { | 85 const AttachmentId& attachment_id) { |
86 syncable::Directory::Metahandles handles; | 86 syncable::Directory::Metahandles handles; |
87 GetDirectory()->GetMetahandlesByAttachmentId( | 87 GetDirectory()->GetMetahandlesByAttachmentId( |
88 transaction_, attachment_id.GetProto(), &handles); | 88 transaction_, attachment_id.GetProto(), &handles); |
89 for (syncable::Directory::Metahandles::iterator iter = handles.begin(); | 89 for (syncable::Directory::Metahandles::iterator iter = handles.begin(); |
90 iter != handles.end(); | 90 iter != handles.end(); |
91 ++iter) { | 91 ++iter) { |
92 syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter); | 92 syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter); |
93 entry.UpdateAttachmentIdWithServerInfo(attachment_id.GetProto()); | 93 entry.MarkAttachmentAsOnServer(attachment_id.GetProto()); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 } // namespace syncer | 97 } // namespace syncer |
OLD | NEW |