OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ipc/attachment_broker_privileged_win.h" | 5 #include "ipc/attachment_broker_privileged_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
10 #include "ipc/attachment_broker_messages.h" | 10 #include "ipc/attachment_broker_messages.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 static_cast<const internal::HandleAttachmentWin*>(attachment); | 27 static_cast<const internal::HandleAttachmentWin*>(attachment); |
28 HandleWireFormat wire_format = | 28 HandleWireFormat wire_format = |
29 handle_attachment->GetWireFormat(destination_process); | 29 handle_attachment->GetWireFormat(destination_process); |
30 HandleWireFormat new_wire_format = | 30 HandleWireFormat new_wire_format = |
31 DuplicateWinHandle(wire_format, base::Process::Current().Pid()); | 31 DuplicateWinHandle(wire_format, base::Process::Current().Pid()); |
32 if (new_wire_format.handle == 0) | 32 if (new_wire_format.handle == 0) |
33 return false; | 33 return false; |
34 RouteDuplicatedHandle(new_wire_format); | 34 RouteDuplicatedHandle(new_wire_format); |
35 return true; | 35 return true; |
36 } | 36 } |
| 37 case BrokerableAttachment::MACH_PORT: |
37 case BrokerableAttachment::PLACEHOLDER: | 38 case BrokerableAttachment::PLACEHOLDER: |
38 NOTREACHED(); | 39 NOTREACHED(); |
39 return false; | 40 return false; |
40 } | 41 } |
41 return false; | 42 return false; |
42 } | 43 } |
43 | 44 |
44 bool AttachmentBrokerPrivilegedWin::OnMessageReceived(const Message& msg) { | 45 bool AttachmentBrokerPrivilegedWin::OnMessageReceived(const Message& msg) { |
45 bool handled = true; | 46 bool handled = true; |
46 switch (msg.type()) { | 47 switch (msg.type()) { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 135 |
135 AttachmentBrokerPrivilegedWin::HandleWireFormat | 136 AttachmentBrokerPrivilegedWin::HandleWireFormat |
136 AttachmentBrokerPrivilegedWin::CopyWireFormat( | 137 AttachmentBrokerPrivilegedWin::CopyWireFormat( |
137 const HandleWireFormat& wire_format, | 138 const HandleWireFormat& wire_format, |
138 int handle) { | 139 int handle) { |
139 return HandleWireFormat(handle, wire_format.destination_process, | 140 return HandleWireFormat(handle, wire_format.destination_process, |
140 wire_format.permissions, wire_format.attachment_id); | 141 wire_format.permissions, wire_format.attachment_id); |
141 } | 142 } |
142 | 143 |
143 } // namespace IPC | 144 } // namespace IPC |
OLD | NEW |