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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 const std::string& name, | 472 const std::string& name, |
473 const GenericAssociatedInterfaceFactory& factory) { | 473 const GenericAssociatedInterfaceFactory& factory) { |
474 base::AutoLock locker(associated_interface_lock_); | 474 base::AutoLock locker(associated_interface_lock_); |
475 auto result = associated_interfaces_.insert({ name, factory }); | 475 auto result = associated_interfaces_.insert({ name, factory }); |
476 DCHECK(result.second); | 476 DCHECK(result.second); |
477 } | 477 } |
478 | 478 |
479 void ChannelMojo::GetGenericRemoteAssociatedInterface( | 479 void ChannelMojo::GetGenericRemoteAssociatedInterface( |
480 const std::string& name, | 480 const std::string& name, |
481 mojo::ScopedInterfaceEndpointHandle handle) { | 481 mojo::ScopedInterfaceEndpointHandle handle) { |
482 if (message_reader_) | 482 if (message_reader_) { |
483 message_reader_->GetRemoteInterface(name, std::move(handle)); | 483 message_reader_->GetRemoteInterface(name, std::move(handle)); |
| 484 } else { |
| 485 // Attach the associated interface to a disconnected pipe, so that the |
| 486 // associated interface pointer can be used to make calls (which are |
| 487 // dropped). |
| 488 mojo::GetIsolatedInterface(std::move(handle)); |
| 489 } |
484 } | 490 } |
485 | 491 |
486 } // namespace IPC | 492 } // namespace IPC |
OLD | NEW |