| 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_channel_mojo.h" | 5 #include "ipc/ipc_channel_mojo.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 #if defined(OS_NACL) | 384 #if defined(OS_NACL) |
| 385 return -1; | 385 return -1; |
| 386 #else | 386 #else |
| 387 return base::GetCurrentProcId(); | 387 return base::GetCurrentProcId(); |
| 388 #endif // defined(OS_NACL) | 388 #endif // defined(OS_NACL) |
| 389 } | 389 } |
| 390 | 390 |
| 391 Channel::AssociatedInterfaceSupport* | 391 Channel::AssociatedInterfaceSupport* |
| 392 ChannelMojo::GetAssociatedInterfaceSupport() { return this; } | 392 ChannelMojo::GetAssociatedInterfaceSupport() { return this; } |
| 393 | 393 |
| 394 void ChannelMojo::SendEventToSignal(mojo::common::mojom::EventPtr event) { |
| 395 if (message_reader_) |
| 396 message_reader_->SendEventToSignal(std::move(event)); |
| 397 } |
| 398 |
| 394 void ChannelMojo::OnPeerPidReceived() { | 399 void ChannelMojo::OnPeerPidReceived() { |
| 395 listener_->OnChannelConnected(static_cast<int32_t>(GetPeerPID())); | 400 listener_->OnChannelConnected(static_cast<int32_t>(GetPeerPID())); |
| 396 } | 401 } |
| 397 | 402 |
| 398 void ChannelMojo::OnMessageReceived(const Message& message) { | 403 void ChannelMojo::OnMessageReceived(const Message& message) { |
| 399 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived", | 404 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived", |
| 400 "class", IPC_MESSAGE_ID_CLASS(message.type()), | 405 "class", IPC_MESSAGE_ID_CLASS(message.type()), |
| 401 "line", IPC_MESSAGE_ID_LINE(message.type())); | 406 "line", IPC_MESSAGE_ID_LINE(message.type())); |
| 402 if (AttachmentBroker* broker = AttachmentBroker::GetGlobal()) { | 407 if (AttachmentBroker* broker = AttachmentBroker::GetGlobal()) { |
| 403 if (broker->OnMessageReceived(message)) | 408 if (broker->OnMessageReceived(message)) |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 } | 498 } |
| 494 | 499 |
| 495 void ChannelMojo::GetGenericRemoteAssociatedInterface( | 500 void ChannelMojo::GetGenericRemoteAssociatedInterface( |
| 496 const std::string& name, | 501 const std::string& name, |
| 497 mojo::ScopedInterfaceEndpointHandle handle) { | 502 mojo::ScopedInterfaceEndpointHandle handle) { |
| 498 if (message_reader_) | 503 if (message_reader_) |
| 499 message_reader_->GetRemoteInterface(name, std::move(handle)); | 504 message_reader_->GetRemoteInterface(name, std::move(handle)); |
| 500 } | 505 } |
| 501 | 506 |
| 502 } // namespace IPC | 507 } // namespace IPC |
| OLD | NEW |