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

Unified Diff: ipc/attachment_broker_privileged_win.cc

Issue 1262543003: ipc: Create an unforgeable mechanism to get the process id of the sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dchecks. Created 5 years, 5 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/attachment_broker_privileged_win.h ('k') | ipc/attachment_broker_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/attachment_broker_privileged_win.cc
diff --git a/ipc/attachment_broker_privileged_win.cc b/ipc/attachment_broker_privileged_win.cc
index 52918a30b4771b9a2ca5d3c989ed64dce61061b2..965f3b45dffe7970f2d048ad9d1dcf40254771aa 100644
--- a/ipc/attachment_broker_privileged_win.cc
+++ b/ipc/attachment_broker_privileged_win.cc
@@ -39,11 +39,11 @@ bool AttachmentBrokerPrivilegedWin::SendAttachmentToProcess(
bool AttachmentBrokerPrivilegedWin::OnMessageReceived(const Message& msg) {
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(AttachmentBrokerPrivilegedWin, msg)
- IPC_MESSAGE_HANDLER(AttachmentBrokerMsg_DuplicateWinHandle,
- OnDuplicateWinHandle)
+ switch (msg.type()) {
+ IPC_MESSAGE_HANDLER_GENERIC(AttachmentBrokerMsg_DuplicateWinHandle,
+ OnDuplicateWinHandle(msg))
IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
+ }
return handled;
}
@@ -62,13 +62,18 @@ void AttachmentBrokerPrivilegedWin::DeregisterCommunicationChannel(
}
void AttachmentBrokerPrivilegedWin::OnDuplicateWinHandle(
- const HandleWireFormat& wire_format,
- base::ProcessId source_pid) {
+ const IPC::Message& message) {
+ AttachmentBrokerMsg_DuplicateWinHandle::Param param;
+ if (!AttachmentBrokerMsg_DuplicateWinHandle::Read(&message, &param))
+ return;
+ IPC::internal::HandleAttachmentWin::WireFormat wire_format =
+ base::get<0>(param);
+
if (wire_format.destination_process == base::kNullProcessId)
return;
HandleWireFormat new_wire_format =
- DuplicateWinHandle(wire_format, source_pid);
+ DuplicateWinHandle(wire_format, message.get_sender_pid());
RouteDuplicatedHandle(new_wire_format);
}
« no previous file with comments | « ipc/attachment_broker_privileged_win.h ('k') | ipc/attachment_broker_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698