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

Unified Diff: ipc/ipc_message.cc

Issue 2494943002: Remove IPC::BrokerableAttachment. (Closed)
Patch Set: extra test output Created 4 years, 1 month 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_message.h ('k') | ipc/ipc_message_attachment.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 008401f14f358c620a7e6a206bb9fb969fa63220..f5e9ac7a8b807cd04842aa8139a5b9b8cfb0b9ee 100644
--- a/ipc/ipc_message.cc
+++ b/ipc/ipc_message.cc
@@ -166,19 +166,15 @@ void Message::FindNext(const char* range_start,
bool Message::WriteAttachment(
scoped_refptr<base::Pickle::Attachment> attachment) {
- bool brokerable;
size_t index;
bool success = attachment_set()->AddAttachment(
make_scoped_refptr(static_cast<MessageAttachment*>(attachment.get())),
- &index, &brokerable);
+ &index);
DCHECK(success);
// NOTE: If you add more data to the pickle, make sure to update
// PickleSizer::AddAttachment.
- // Write the type of descriptor.
- WriteBool(brokerable);
-
// Write the index of the descriptor so that we don't have to
// keep the current descriptor as extra decoding state when deserialising.
WriteInt(static_cast<int>(index));
@@ -189,10 +185,6 @@ bool Message::WriteAttachment(
bool Message::ReadAttachment(
base::PickleIterator* iter,
scoped_refptr<base::Pickle::Attachment>* attachment) const {
- bool brokerable;
- if (!iter->ReadBool(&brokerable))
- return false;
-
int index;
if (!iter->ReadInt(&index))
return false;
@@ -201,9 +193,7 @@ bool Message::ReadAttachment(
if (!attachment_set)
return false;
- *attachment = brokerable
- ? attachment_set->GetBrokerableAttachmentAt(index)
- : attachment_set->GetNonBrokerableAttachmentAt(index);
+ *attachment = attachment_set->GetAttachmentAt(index);
return nullptr != attachment->get();
}
@@ -212,13 +202,4 @@ bool Message::HasAttachments() const {
return attachment_set_.get() && !attachment_set_->empty();
}
-bool Message::HasMojoHandles() const {
- return attachment_set_.get() && attachment_set_->num_mojo_handles() > 0;
-}
-
-bool Message::HasBrokerableAttachments() const {
- return attachment_set_.get() &&
- attachment_set_->num_brokerable_attachments() > 0;
-}
-
} // namespace IPC
« no previous file with comments | « ipc/ipc_message.h ('k') | ipc/ipc_message_attachment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698