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_channel_proxy.h" | 5 #include "ipc/ipc_channel_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 if (channel_send_thread_safe_) { | 334 if (channel_send_thread_safe_) { |
335 SendFromThisThread(message); | 335 SendFromThisThread(message); |
336 return; | 336 return; |
337 } | 337 } |
338 | 338 |
339 ipc_task_runner()->PostTask( | 339 ipc_task_runner()->PostTask( |
340 FROM_HERE, base::Bind(&ChannelProxy::Context::OnSendMessage, this, | 340 FROM_HERE, base::Bind(&ChannelProxy::Context::OnSendMessage, this, |
341 base::Passed(scoped_ptr<Message>(message)))); | 341 base::Passed(scoped_ptr<Message>(message)))); |
342 } | 342 } |
343 | 343 |
| 344 bool ChannelProxy::Context::IsChannelSendThreadSafe() const { |
| 345 return channel_send_thread_safe_; |
| 346 } |
| 347 |
344 //----------------------------------------------------------------------------- | 348 //----------------------------------------------------------------------------- |
345 | 349 |
346 // static | 350 // static |
347 scoped_ptr<ChannelProxy> ChannelProxy::Create( | 351 scoped_ptr<ChannelProxy> ChannelProxy::Create( |
348 const IPC::ChannelHandle& channel_handle, | 352 const IPC::ChannelHandle& channel_handle, |
349 Channel::Mode mode, | 353 Channel::Mode mode, |
350 Listener* listener, | 354 Listener* listener, |
351 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, | 355 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, |
352 AttachmentBroker* broker) { | 356 AttachmentBroker* broker) { |
353 scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner)); | 357 scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner)); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 510 } |
507 #endif | 511 #endif |
508 | 512 |
509 void ChannelProxy::SetAttachmentBrokerEndpoint(bool is_endpoint) { | 513 void ChannelProxy::SetAttachmentBrokerEndpoint(bool is_endpoint) { |
510 context()->set_attachment_broker_endpoint(is_endpoint); | 514 context()->set_attachment_broker_endpoint(is_endpoint); |
511 } | 515 } |
512 | 516 |
513 //----------------------------------------------------------------------------- | 517 //----------------------------------------------------------------------------- |
514 | 518 |
515 } // namespace IPC | 519 } // namespace IPC |
OLD | NEW |