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_mac.h" | 5 #include "ipc/attachment_broker_privileged_mac.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
|
Tom Sepez
2016/03/07 19:05:01
ditto
tzik
2016/03/08 03:32:59
Done.
| |
| 9 #include "base/mac/scoped_mach_port.h" | 9 #include "base/mac/scoped_mach_port.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| 11 #include "base/process/port_provider_mac.h" | 11 #include "base/process/port_provider_mac.h" |
| 12 #include "base/process/process.h" | 12 #include "base/process/process.h" |
| 13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "ipc/attachment_broker_messages.h" | 14 #include "ipc/attachment_broker_messages.h" |
| 15 #include "ipc/brokerable_attachment.h" | 15 #include "ipc/brokerable_attachment.h" |
| 16 #include "ipc/ipc_channel.h" | 16 #include "ipc/ipc_channel.h" |
| 17 #include "ipc/mach_port_attachment_mac.h" | 17 #include "ipc/mach_port_attachment_mac.h" |
| 18 | 18 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 | 176 |
| 177 void AttachmentBrokerPrivilegedMac::OnDuplicateMachPort( | 177 void AttachmentBrokerPrivilegedMac::OnDuplicateMachPort( |
| 178 const IPC::Message& message) { | 178 const IPC::Message& message) { |
| 179 DCHECK_NE(0, message.get_sender_pid()); | 179 DCHECK_NE(0, message.get_sender_pid()); |
| 180 AttachmentBrokerMsg_DuplicateMachPort::Param param; | 180 AttachmentBrokerMsg_DuplicateMachPort::Param param; |
| 181 if (!AttachmentBrokerMsg_DuplicateMachPort::Read(&message, ¶m)) { | 181 if (!AttachmentBrokerMsg_DuplicateMachPort::Read(&message, ¶m)) { |
| 182 LogError(ERROR_PARSE_DUPLICATE_MACH_PORT_MESSAGE); | 182 LogError(ERROR_PARSE_DUPLICATE_MACH_PORT_MESSAGE); |
| 183 return; | 183 return; |
| 184 } | 184 } |
| 185 IPC::internal::MachPortAttachmentMac::WireFormat wire_format = | 185 IPC::internal::MachPortAttachmentMac::WireFormat wire_format = |
| 186 base::get<0>(param); | 186 std::get<0>(param); |
| 187 | 187 |
| 188 if (wire_format.destination_process == base::kNullProcessId) { | 188 if (wire_format.destination_process == base::kNullProcessId) { |
| 189 LogError(NO_DESTINATION); | 189 LogError(NO_DESTINATION); |
| 190 return; | 190 return; |
| 191 } | 191 } |
| 192 | 192 |
| 193 AddExtractor(message.get_sender_pid(), wire_format.destination_process, | 193 AddExtractor(message.get_sender_pid(), wire_format.destination_process, |
| 194 wire_format.mach_port, wire_format.attachment_id); | 194 wire_format.mach_port, wire_format.attachment_id); |
| 195 ProcessExtractorsForProcess(message.get_sender_pid()); | 195 ProcessExtractorsForProcess(message.get_sender_pid()); |
| 196 } | 196 } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 | 442 |
| 443 auto it = extractors_.find(source_pid); | 443 auto it = extractors_.find(source_pid); |
| 444 if (it == extractors_.end()) | 444 if (it == extractors_.end()) |
| 445 extractors_[source_pid] = new ScopedVector<AttachmentExtractor>; | 445 extractors_[source_pid] = new ScopedVector<AttachmentExtractor>; |
| 446 | 446 |
| 447 extractors_[source_pid]->push_back( | 447 extractors_[source_pid]->push_back( |
| 448 new AttachmentExtractor(source_pid, dest_pid, port, id)); | 448 new AttachmentExtractor(source_pid, dest_pid, port, id)); |
| 449 } | 449 } |
| 450 | 450 |
| 451 } // namespace IPC | 451 } // namespace IPC |
| OLD | NEW |