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

Unified Diff: ipc/ipc_message_utils.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_utils.h ('k') | ipc/ipc_mojo_handle_attachment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils.cc
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index f814727ee2b81fff5694adc45d94d0011d477105..be83e5a236bb2322e66b36d13aa0640759cdc691 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -658,8 +658,14 @@ bool ParamTraits<base::FileDescriptor>::Read(const base::Pickle* m,
if (!m->ReadAttachment(iter, &attachment))
return false;
+ if (static_cast<MessageAttachment*>(attachment.get())->GetType() !=
+ MessageAttachment::Type::PLATFORM_FILE) {
+ return false;
+ }
+
*r = base::FileDescriptor(
- static_cast<MessageAttachment*>(attachment.get())->TakePlatformFile(),
+ static_cast<internal::PlatformFileAttachment*>(attachment.get())
+ ->TakePlatformFile(),
true);
return true;
}
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | ipc/ipc_mojo_handle_attachment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698