| 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 std::move(unwrapped_attachment)); | 461 std::move(unwrapped_attachment)); |
| 462 DCHECK(ok); | 462 DCHECK(ok); |
| 463 if (!ok) { | 463 if (!ok) { |
| 464 LOG(ERROR) << "Failed to add new Mojo handle."; | 464 LOG(ERROR) << "Failed to add new Mojo handle."; |
| 465 return MOJO_RESULT_UNKNOWN; | 465 return MOJO_RESULT_UNKNOWN; |
| 466 } | 466 } |
| 467 } | 467 } |
| 468 return MOJO_RESULT_OK; | 468 return MOJO_RESULT_OK; |
| 469 } | 469 } |
| 470 | 470 |
| 471 mojo::AssociatedGroup* ChannelMojo::GetAssociatedGroup() { | |
| 472 DCHECK(bootstrap_); | |
| 473 return bootstrap_->GetAssociatedGroup(); | |
| 474 } | |
| 475 | |
| 476 void ChannelMojo::AddGenericAssociatedInterface( | 471 void ChannelMojo::AddGenericAssociatedInterface( |
| 477 const std::string& name, | 472 const std::string& name, |
| 478 const GenericAssociatedInterfaceFactory& factory) { | 473 const GenericAssociatedInterfaceFactory& factory) { |
| 479 base::AutoLock locker(associated_interface_lock_); | 474 base::AutoLock locker(associated_interface_lock_); |
| 480 auto result = associated_interfaces_.insert({ name, factory }); | 475 auto result = associated_interfaces_.insert({ name, factory }); |
| 481 DCHECK(result.second); | 476 DCHECK(result.second); |
| 482 } | 477 } |
| 483 | 478 |
| 484 void ChannelMojo::GetGenericRemoteAssociatedInterface( | 479 void ChannelMojo::GetGenericRemoteAssociatedInterface( |
| 485 const std::string& name, | 480 const std::string& name, |
| 486 mojo::ScopedInterfaceEndpointHandle handle) { | 481 mojo::ScopedInterfaceEndpointHandle handle) { |
| 487 if (message_reader_) | 482 if (message_reader_) |
| 488 message_reader_->GetRemoteInterface(name, std::move(handle)); | 483 message_reader_->GetRemoteInterface(name, std::move(handle)); |
| 489 } | 484 } |
| 490 | 485 |
| 491 } // namespace IPC | 486 } // namespace IPC |
| OLD | NEW |