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

Unified Diff: ipc/ipc_channel_reader.cc

Issue 1317093007: ipc: Make a new class PlaceholderBrokerableAttachment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More rebase errors. Created 5 years, 3 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 | « ipc/ipc.gypi ('k') | ipc/ipc_channel_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ipc/ipc.gypi ('k') | ipc/ipc_channel_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698