Chromium Code Reviews| 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_; |