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

Unified Diff: sync/internal_api/base_node.cc

Issue 264793007: Keep track of which attachments are referenced by which sync entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory leak. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/engine/get_commit_ids.cc ('k') | sync/internal_api/public/base/attachment_id_proto.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/base_node.cc
diff --git a/sync/internal_api/base_node.cc b/sync/internal_api/base_node.cc
index 078839540e3e66c4a9bfeb5ccd32646fa86410b6..57dbb22f72115e58dd8221f769afe2baf78bf5fc 100644
--- a/sync/internal_api/base_node.cc
+++ b/sync/internal_api/base_node.cc
@@ -291,10 +291,13 @@ ModelType BaseNode::GetModelType() const {
}
const syncer::AttachmentIdList BaseNode::GetAttachmentIds() const {
- // TODO(maniscalco): Once EntryKernel is capable of storing AttachmentIds,
- // update this method to retrieve the list of AttachmentIds from read_node and
- // pass it to CreateRemoteData (bug 348625).
- return AttachmentIdList();
+ AttachmentIdList result;
+ const sync_pb::AttachmentMetadata& metadata =
+ GetEntry()->GetAttachmentMetadata();
+ for (int i = 0; i < metadata.record_size(); ++i) {
+ result.push_back(AttachmentId::CreateFromProto(metadata.record(i).id()));
+ }
+ return result;
}
void BaseNode::SetUnencryptedSpecifics(
« no previous file with comments | « sync/engine/get_commit_ids.cc ('k') | sync/internal_api/public/base/attachment_id_proto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698