Index: sync/internal_api/write_transaction.cc |
diff --git a/sync/internal_api/write_transaction.cc b/sync/internal_api/write_transaction.cc |
index b2dfe87da1785038367047bd1f0bb05b0f7d5eef..70e902954dc1f54ad87646c36bb0fddf513e4275 100644 |
--- a/sync/internal_api/write_transaction.cc |
+++ b/sync/internal_api/write_transaction.cc |
@@ -5,6 +5,7 @@ |
#include "sync/internal_api/public/write_transaction.h" |
#include "sync/syncable/directory.h" |
+#include "sync/syncable/mutable_entry.h" |
#include "sync/syncable/syncable_write_transaction.h" |
namespace syncer { |
@@ -80,4 +81,17 @@ void WriteTransaction::SetDataTypeContext( |
// See crbug.com/360280 |
} |
+void WriteTransaction::UpdateEntriesWithAttachmentId( |
+ const AttachmentId& attachment_id) { |
+ syncable::Directory::Metahandles handles; |
+ GetDirectory()->GetMetahandlesByAttachmentId( |
+ transaction_, attachment_id.GetProto(), &handles); |
+ for (syncable::Directory::Metahandles::iterator iter = handles.begin(); |
+ iter != handles.end(); |
+ ++iter) { |
+ syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter); |
+ entry.UpdateAttachmentIdWithServerInfo(attachment_id.GetProto()); |
+ } |
+} |
+ |
} // namespace syncer |