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

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: 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..2d8953c4e8f413d7ac0c11c9239430a9e39d22ce 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -458,6 +458,19 @@ void Directory::UpdateAttachmentIndex(
AddToAttachmentIndex(metahandle, new_metadata, lock);
}
+void Directory::GetMetahandlesByAttachmentId(
+ BaseTransaction* trans,
maniscalco 2014/05/09 18:12:11 I want to confirm my understanding. The only reas
pavely 2014/05/13 23:06:44 Yes, that's right. If unaware developer tries to c
maniscalco 2014/05/15 20:09:28 Yeah, the only reason I suggesting DCHECKing the t
+ const sync_pb::AttachmentIdProto& attachment_id_proto,
+ Metahandles* result) {
maniscalco 2014/05/09 18:12:11 nit: consider DCHECKing result.
pavely 2014/05/13 23:06:44 Done.
+ ScopedKernelLock lock(this);
+ IndexByAttachmentId::iterator index_iter =
maniscalco 2014/05/09 18:12:11 Could this be made a const_iterator?
pavely 2014/05/13 23:06:44 Done.
+ kernel_->index_by_attachment_id.find(attachment_id_proto.unique_id());
+ if (index_iter == kernel_->index_by_attachment_id.end())
+ return;
maniscalco 2014/05/09 18:12:11 From the header comment and method name, it's not
pavely 2014/05/13 23:06:44 Yes, I should have cleared it. Done. On 2014/05/09
+ const MetahandleSet& metahandle_set = index_iter->second;
+ copy(metahandle_set.begin(), metahandle_set.end(), back_inserter(*result));
maniscalco 2014/05/09 18:12:11 Huh, I would have expected this to need std::. Ma
pavely 2014/05/13 23:06:44 Maybe... I copied it from GetUnsyncedMetaHandles.
+}
+
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