Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mojo/edk/system/node_channel.h" | 5 #include "mojo/edk/system/node_channel.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 709 remote_process_handle = remote_process_handle_; | 709 remote_process_handle = remote_process_handle_; |
| 710 } | 710 } |
| 711 | 711 |
| 712 // Rewrite outgoing handles if we have a handle to the destination process. | 712 // Rewrite outgoing handles if we have a handle to the destination process. |
| 713 if (remote_process_handle != base::kNullProcessHandle) { | 713 if (remote_process_handle != base::kNullProcessHandle) { |
| 714 if (!message->RewriteHandles(base::GetCurrentProcessHandle(), | 714 if (!message->RewriteHandles(base::GetCurrentProcessHandle(), |
| 715 remote_process_handle, message->handles(), | 715 remote_process_handle, message->handles(), |
| 716 message->num_handles())) { | 716 message->num_handles())) { |
| 717 DLOG(ERROR) << "Failed to duplicate one or more outgoing handles."; | 717 DLOG(ERROR) << "Failed to duplicate one or more outgoing handles."; |
| 718 } | 718 } |
| 719 LOG(ERROR) << "OWNER OF HANDLE GOING TO BE " << remote_process_handle; | |
|
Anand Mistry (off Chromium)
2016/05/23 07:16:52
debugging?
Ken Rockot(use gerrit already)
2016/05/23 17:17:53
Woops. Removed.
| |
| 719 } | 720 } |
| 720 } | 721 } |
| 721 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 722 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| 722 // On OSX, we need to transfer mach ports to the destination process before | 723 // On OSX, we need to transfer mach ports to the destination process before |
| 723 // transferring the message itself. | 724 // transferring the message itself. |
| 724 if (message->has_mach_ports()) { | 725 if (message->has_mach_ports()) { |
| 725 MachPortRelay* relay = delegate_->GetMachPortRelay(); | 726 MachPortRelay* relay = delegate_->GetMachPortRelay(); |
| 726 if (relay) { | 727 if (relay) { |
| 727 base::ProcessHandle remote_process_handle; | 728 base::ProcessHandle remote_process_handle; |
| 728 { | 729 { |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 755 | 756 |
| 756 base::AutoLock lock(channel_lock_); | 757 base::AutoLock lock(channel_lock_); |
| 757 if (!channel_) | 758 if (!channel_) |
| 758 DLOG(ERROR) << "Dropping message on closed channel."; | 759 DLOG(ERROR) << "Dropping message on closed channel."; |
| 759 else | 760 else |
| 760 channel_->Write(std::move(message)); | 761 channel_->Write(std::move(message)); |
| 761 } | 762 } |
| 762 | 763 |
| 763 } // namespace edk | 764 } // namespace edk |
| 764 } // namespace mojo | 765 } // namespace mojo |
| OLD | NEW |