OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_sync_message_filter.h" | 5 #include "ipc/ipc_sync_message_filter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // message loop is destroyed. Since that destruction indicates shutdown | 269 // message loop is destroyed. Since that destruction indicates shutdown |
270 // anyway, we manually signal the shutdown event in this case. | 270 // anyway, we manually signal the shutdown event in this case. |
271 shutdown_mojo_event_.Signal(); | 271 shutdown_mojo_event_.Signal(); |
272 } | 272 } |
273 | 273 |
274 void SyncMessageFilter::GetGenericRemoteAssociatedInterface( | 274 void SyncMessageFilter::GetGenericRemoteAssociatedInterface( |
275 const std::string& interface_name, | 275 const std::string& interface_name, |
276 mojo::ScopedInterfaceEndpointHandle handle) { | 276 mojo::ScopedInterfaceEndpointHandle handle) { |
277 base::AutoLock auto_lock(lock_); | 277 base::AutoLock auto_lock(lock_); |
278 DCHECK(io_task_runner_ && io_task_runner_->BelongsToCurrentThread()); | 278 DCHECK(io_task_runner_ && io_task_runner_->BelongsToCurrentThread()); |
279 if (!channel_) | 279 if (!channel_) { |
| 280 // Attach the associated interface to a disconnected pipe, so that the |
| 281 // associated interface pointer can be used to make calls (which are |
| 282 // dropped). |
| 283 mojo::GetIsolatedInterface(std::move(handle)); |
280 return; | 284 return; |
| 285 } |
281 | 286 |
282 Channel::AssociatedInterfaceSupport* support = | 287 Channel::AssociatedInterfaceSupport* support = |
283 channel_->GetAssociatedInterfaceSupport(); | 288 channel_->GetAssociatedInterfaceSupport(); |
284 support->GetGenericRemoteAssociatedInterface( | 289 support->GetGenericRemoteAssociatedInterface( |
285 interface_name, std::move(handle)); | 290 interface_name, std::move(handle)); |
286 } | 291 } |
287 | 292 |
288 } // namespace IPC | 293 } // namespace IPC |
OLD | NEW |