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

Unified Diff: sync/syncable/directory.cc

Issue 272043002: Invoke AttachmentUploader and update AttachmentIds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize through SyncApiComponentFactory Created 6 years, 7 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
Index: sync/syncable/directory.cc
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index cebb2d4fd8401cf0410de0bf543e9c89dc55f148..cf6f26a51ca5b47b1db1804c8dd7da71bc17bd36 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -458,6 +458,22 @@ void Directory::UpdateAttachmentIndex(
AddToAttachmentIndex(metahandle, new_metadata, lock);
}
+void Directory::GetMetahandlesByAttachmentId(
+ BaseTransaction* trans,
+ const sync_pb::AttachmentIdProto& attachment_id_proto,
+ Metahandles* result) {
+ DCHECK(result);
+ result->clear();
+ ScopedKernelLock lock(this);
+ IndexByAttachmentId::const_iterator index_iter =
+ kernel_->index_by_attachment_id.find(attachment_id_proto.unique_id());
+ if (index_iter == kernel_->index_by_attachment_id.end())
+ return;
+ const MetahandleSet& metahandle_set = index_iter->second;
+ std::copy(
+ metahandle_set.begin(), metahandle_set.end(), back_inserter(*result));
+}
+
bool Directory::unrecoverable_error_set(const BaseTransaction* trans) const {
DCHECK(trans != NULL);
return unrecoverable_error_set_;

Powered by Google App Engine
This is Rietveld 408576698