| 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 ChannelMojo::GetAssociatedInterfaceSupport() { return this; } | 392 ChannelMojo::GetAssociatedInterfaceSupport() { return this; } |
| 393 | 393 |
| 394 void ChannelMojo::OnPeerPidReceived() { | 394 void ChannelMojo::OnPeerPidReceived() { |
| 395 listener_->OnChannelConnected(static_cast<int32_t>(GetPeerPID())); | 395 listener_->OnChannelConnected(static_cast<int32_t>(GetPeerPID())); |
| 396 } | 396 } |
| 397 | 397 |
| 398 void ChannelMojo::OnMessageReceived(const Message& message) { | 398 void ChannelMojo::OnMessageReceived(const Message& message) { |
| 399 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived", | 399 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived", |
| 400 "class", IPC_MESSAGE_ID_CLASS(message.type()), | 400 "class", IPC_MESSAGE_ID_CLASS(message.type()), |
| 401 "line", IPC_MESSAGE_ID_LINE(message.type())); | 401 "line", IPC_MESSAGE_ID_LINE(message.type())); |
| 402 if (AttachmentBroker* broker = AttachmentBroker::GetGlobal()) { | |
| 403 if (broker->OnMessageReceived(message)) | |
| 404 return; | |
| 405 } | |
| 406 listener_->OnMessageReceived(message); | 402 listener_->OnMessageReceived(message); |
| 407 if (message.dispatch_error()) | 403 if (message.dispatch_error()) |
| 408 listener_->OnBadMessageReceived(message); | 404 listener_->OnBadMessageReceived(message); |
| 409 } | 405 } |
| 410 | 406 |
| 411 #if defined(OS_POSIX) && !defined(OS_NACL_SFI) | 407 #if defined(OS_POSIX) && !defined(OS_NACL_SFI) |
| 412 int ChannelMojo::GetClientFileDescriptor() const { | 408 int ChannelMojo::GetClientFileDescriptor() const { |
| 413 return -1; | 409 return -1; |
| 414 } | 410 } |
| 415 | 411 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 } | 489 } |
| 494 | 490 |
| 495 void ChannelMojo::GetGenericRemoteAssociatedInterface( | 491 void ChannelMojo::GetGenericRemoteAssociatedInterface( |
| 496 const std::string& name, | 492 const std::string& name, |
| 497 mojo::ScopedInterfaceEndpointHandle handle) { | 493 mojo::ScopedInterfaceEndpointHandle handle) { |
| 498 if (message_reader_) | 494 if (message_reader_) |
| 499 message_reader_->GetRemoteInterface(name, std::move(handle)); | 495 message_reader_->GetRemoteInterface(name, std::move(handle)); |
| 500 } | 496 } |
| 501 | 497 |
| 502 } // namespace IPC | 498 } // namespace IPC |
| OLD | NEW |