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

Unified Diff: ipc/ipc_message.cc

Issue 1414503009: IPC: Remove unnecessary conversions of BrokerableAttachment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from tsepez. Created 5 years, 2 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_channel_win.cc ('k') | ipc/ipc_message_attachment_set.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message.cc
diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc
index 2738bf13bc254087f560ea7474c696e901abaaec..d64c802849620483f0287a8737e3251c62073d95 100644
--- a/ipc/ipc_message.cc
+++ b/ipc/ipc_message.cc
@@ -147,16 +147,15 @@ Message::NextMessageInfo::~NextMessageInfo() {}
Message::SerializedAttachmentIds
Message::SerializedIdsOfBrokerableAttachments() {
DCHECK(HasBrokerableAttachments());
- std::vector<BrokerableAttachment*> attachments =
- attachment_set_->GetBrokerableAttachments();
+ std::vector<scoped_refptr<IPC::BrokerableAttachment>> attachments(
+ attachment_set_->GetBrokerableAttachments());
CHECK_LE(attachments.size(), std::numeric_limits<size_t>::max() /
BrokerableAttachment::kNonceSize);
size_t size = attachments.size() * BrokerableAttachment::kNonceSize;
char* buffer = static_cast<char*>(malloc(size));
for (size_t i = 0; i < attachments.size(); ++i) {
- const BrokerableAttachment* attachment = attachments[i];
char* start_range = buffer + i * BrokerableAttachment::kNonceSize;
- BrokerableAttachment::AttachmentId id = attachment->GetIdentifier();
+ BrokerableAttachment::AttachmentId id = attachments[i]->GetIdentifier();
id.SerializeToBuffer(start_range, BrokerableAttachment::kNonceSize);
}
SerializedAttachmentIds ids;
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_message_attachment_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698