| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ipc_message_pipe_reader.h" | 5 #include "ipc/ipc_message_pipe_reader.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 result = mojo::WriteMessageNew(sender_pipe_, mojo_message->TakeMojoMessage(), | 109 result = mojo::WriteMessageNew(sender_pipe_, mojo_message->TakeMojoMessage(), |
| 110 MOJO_WRITE_MESSAGE_FLAG_NONE); | 110 MOJO_WRITE_MESSAGE_FLAG_NONE); |
| 111 | 111 |
| 112 DVLOG(4) << "Send " << message->type() << ": " << message->size(); | 112 DVLOG(4) << "Send " << message->type() << ": " << message->size(); |
| 113 return result == MOJO_RESULT_OK; | 113 return result == MOJO_RESULT_OK; |
| 114 } | 114 } |
| 115 | 115 |
| 116 void MessagePipeReader::GetRemoteInterface( | 116 void MessagePipeReader::GetRemoteInterface( |
| 117 const std::string& name, | 117 const std::string& name, |
| 118 mojo::ScopedInterfaceEndpointHandle handle) { | 118 mojo::ScopedInterfaceEndpointHandle handle) { |
| 119 if (!sender_.is_bound()) |
| 120 return; |
| 119 mojom::GenericInterfaceAssociatedRequest request; | 121 mojom::GenericInterfaceAssociatedRequest request; |
| 120 request.Bind(std::move(handle)); | 122 request.Bind(std::move(handle)); |
| 121 sender_->GetAssociatedInterface(name, std::move(request)); | 123 sender_->GetAssociatedInterface(name, std::move(request)); |
| 122 } | 124 } |
| 123 | 125 |
| 124 void MessagePipeReader::SetPeerPid(int32_t peer_pid) { | 126 void MessagePipeReader::SetPeerPid(int32_t peer_pid) { |
| 125 peer_pid_ = peer_pid; | 127 peer_pid_ = peer_pid; |
| 126 delegate_->OnPeerPidReceived(); | 128 delegate_->OnPeerPidReceived(); |
| 127 } | 129 } |
| 128 | 130 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 165 |
| 164 Close(); | 166 Close(); |
| 165 | 167 |
| 166 // NOTE: The delegate call below may delete |this|. | 168 // NOTE: The delegate call below may delete |this|. |
| 167 if (delegate_) | 169 if (delegate_) |
| 168 delegate_->OnPipeError(); | 170 delegate_->OnPipeError(); |
| 169 } | 171 } |
| 170 | 172 |
| 171 } // namespace internal | 173 } // namespace internal |
| 172 } // namespace IPC | 174 } // namespace IPC |
| OLD | NEW |