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

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: Fix Android build 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
« no previous file with comments | « sync/syncable/directory.h ('k') | sync/syncable/directory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory.cc
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index e523bcdf290cec0d608792bb761b257e632d2a9e..39233fee410acda35fcbb382f9473725a0ad6bdd 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -463,6 +463,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_;
« no previous file with comments | « sync/syncable/directory.h ('k') | sync/syncable/directory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698