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_channel.h" | 5 #include "ipc/ipc_sync_channel.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 return base::Bind(&SyncChannel::SyncContext::OnWaitableEventSignaled, this); | 405 return base::Bind(&SyncChannel::SyncContext::OnWaitableEventSignaled, this); |
406 } | 406 } |
407 | 407 |
408 // static | 408 // static |
409 scoped_ptr<SyncChannel> SyncChannel::Create( | 409 scoped_ptr<SyncChannel> SyncChannel::Create( |
410 const IPC::ChannelHandle& channel_handle, | 410 const IPC::ChannelHandle& channel_handle, |
411 Channel::Mode mode, | 411 Channel::Mode mode, |
412 Listener* listener, | 412 Listener* listener, |
413 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, | 413 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, |
414 bool create_pipe_now, | 414 bool create_pipe_now, |
415 base::WaitableEvent* shutdown_event) { | 415 base::WaitableEvent* shutdown_event, |
| 416 AttachmentBroker* broker) { |
416 scoped_ptr<SyncChannel> channel = | 417 scoped_ptr<SyncChannel> channel = |
417 Create(listener, ipc_task_runner, shutdown_event); | 418 Create(listener, ipc_task_runner, shutdown_event); |
418 channel->Init(channel_handle, mode, create_pipe_now); | 419 channel->Init(channel_handle, mode, create_pipe_now, broker); |
419 return channel.Pass(); | 420 return channel.Pass(); |
420 } | 421 } |
421 | 422 |
422 // static | 423 // static |
423 scoped_ptr<SyncChannel> SyncChannel::Create( | 424 scoped_ptr<SyncChannel> SyncChannel::Create( |
424 scoped_ptr<ChannelFactory> factory, | 425 scoped_ptr<ChannelFactory> factory, |
425 Listener* listener, | 426 Listener* listener, |
426 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, | 427 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, |
427 bool create_pipe_now, | 428 bool create_pipe_now, |
428 base::WaitableEvent* shutdown_event) { | 429 base::WaitableEvent* shutdown_event) { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 // manual reset since the object watcher might otherwise reset the event | 578 // manual reset since the object watcher might otherwise reset the event |
578 // when we're doing a WaitMany. | 579 // when we're doing a WaitMany. |
579 dispatch_watcher_callback_ = | 580 dispatch_watcher_callback_ = |
580 base::Bind(&SyncChannel::OnWaitableEventSignaled, | 581 base::Bind(&SyncChannel::OnWaitableEventSignaled, |
581 base::Unretained(this)); | 582 base::Unretained(this)); |
582 dispatch_watcher_.StartWatching(sync_context()->GetDispatchEvent(), | 583 dispatch_watcher_.StartWatching(sync_context()->GetDispatchEvent(), |
583 dispatch_watcher_callback_); | 584 dispatch_watcher_callback_); |
584 } | 585 } |
585 | 586 |
586 } // namespace IPC | 587 } // namespace IPC |
OLD | NEW |