Chromium Code Reviews| 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" |
|
Tom Sepez
2016/03/07 19:05:01
ditto
tzik
2016/03/08 03:32:59
Done.
| |
| 10 #include "ipc/attachment_broker_messages.h" | 10 #include "ipc/attachment_broker_messages.h" |
| 11 #include "ipc/brokerable_attachment.h" | 11 #include "ipc/brokerable_attachment.h" |
| 12 #include "ipc/handle_attachment_win.h" | 12 #include "ipc/handle_attachment_win.h" |
| 13 #include "ipc/ipc_channel.h" | 13 #include "ipc/ipc_channel.h" |
| 14 | 14 |
| 15 namespace IPC { | 15 namespace IPC { |
| 16 | 16 |
| 17 AttachmentBrokerPrivilegedWin::AttachmentBrokerPrivilegedWin() {} | 17 AttachmentBrokerPrivilegedWin::AttachmentBrokerPrivilegedWin() {} |
| 18 | 18 |
| 19 AttachmentBrokerPrivilegedWin::~AttachmentBrokerPrivilegedWin() {} | 19 AttachmentBrokerPrivilegedWin::~AttachmentBrokerPrivilegedWin() {} |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 } | 52 } |
| 53 return handled; | 53 return handled; |
| 54 } | 54 } |
| 55 | 55 |
| 56 void AttachmentBrokerPrivilegedWin::OnDuplicateWinHandle( | 56 void AttachmentBrokerPrivilegedWin::OnDuplicateWinHandle( |
| 57 const IPC::Message& message) { | 57 const IPC::Message& message) { |
| 58 AttachmentBrokerMsg_DuplicateWinHandle::Param param; | 58 AttachmentBrokerMsg_DuplicateWinHandle::Param param; |
| 59 if (!AttachmentBrokerMsg_DuplicateWinHandle::Read(&message, ¶m)) | 59 if (!AttachmentBrokerMsg_DuplicateWinHandle::Read(&message, ¶m)) |
| 60 return; | 60 return; |
| 61 IPC::internal::HandleAttachmentWin::WireFormat wire_format = | 61 IPC::internal::HandleAttachmentWin::WireFormat wire_format = |
| 62 base::get<0>(param); | 62 std::get<0>(param); |
| 63 | 63 |
| 64 if (wire_format.destination_process == base::kNullProcessId) { | 64 if (wire_format.destination_process == base::kNullProcessId) { |
| 65 LogError(NO_DESTINATION); | 65 LogError(NO_DESTINATION); |
| 66 return; | 66 return; |
| 67 } | 67 } |
| 68 | 68 |
| 69 HandleWireFormat new_wire_format = | 69 HandleWireFormat new_wire_format = |
| 70 DuplicateWinHandle(wire_format, message.get_sender_pid()); | 70 DuplicateWinHandle(wire_format, message.get_sender_pid()); |
| 71 RouteDuplicatedHandle(new_wire_format); | 71 RouteDuplicatedHandle(new_wire_format); |
| 72 } | 72 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 | 147 |
| 148 AttachmentBrokerPrivilegedWin::HandleWireFormat | 148 AttachmentBrokerPrivilegedWin::HandleWireFormat |
| 149 AttachmentBrokerPrivilegedWin::CopyWireFormat( | 149 AttachmentBrokerPrivilegedWin::CopyWireFormat( |
| 150 const HandleWireFormat& wire_format, | 150 const HandleWireFormat& wire_format, |
| 151 int handle) { | 151 int handle) { |
| 152 return HandleWireFormat(handle, wire_format.destination_process, | 152 return HandleWireFormat(handle, wire_format.destination_process, |
| 153 wire_format.permissions, wire_format.attachment_id); | 153 wire_format.permissions, wire_format.attachment_id); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace IPC | 156 } // namespace IPC |
| OLD | NEW |