Index: ipc/ipc_channel_reader.cc |
diff --git a/ipc/ipc_channel_reader.cc b/ipc/ipc_channel_reader.cc |
index b3dd0b704d9f387787711358ab72ec606fd219d5..031417b03cedc87ea3b601f3deba7efff1e04400 100644 |
--- a/ipc/ipc_channel_reader.cc |
+++ b/ipc/ipc_channel_reader.cc |
@@ -97,8 +97,8 @@ bool ChannelReader::TranslateInputData(const char* input_data, |
int pickle_len = static_cast<int>(info.pickle_end - p); |
Message translated_message(p, pickle_len); |
- // TODO(erikchen): Make attachments for info.attachment_ids. |
- // http://crbug.com/493414. |
+ for (const auto& id : info.attachment_ids) |
+ translated_message.AddPlaceholderBrokerableAttachmentWithId(id); |
if (!GetNonBrokeredAttachments(&translated_message)) |
return false; |
@@ -201,8 +201,9 @@ ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments( |
#if USE_ATTACHMENT_BROKER |
MessageAttachmentSet* set = msg->attachment_set(); |
- for (const scoped_refptr<BrokerableAttachment>& attachment : |
- set->GetBrokerableAttachmentsForUpdating()) { |
+ std::vector<const BrokerableAttachment*> brokerable_attachments_copy = |
+ set->PeekBrokerableAttachments(); |
+ for (const BrokerableAttachment* attachment : brokerable_attachments_copy) { |
if (attachment->NeedsBrokering()) { |
AttachmentBroker* broker = GetAttachmentBroker(); |
scoped_refptr<BrokerableAttachment> brokered_attachment; |
@@ -213,7 +214,7 @@ ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments( |
continue; |
} |
- attachment->PopulateWithAttachment(brokered_attachment.get()); |
+ set->ReplacePlaceholderWithAttachment(brokered_attachment); |
} |
} |
#endif // USE_ATTACHMENT_BROKER |