| 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/mojo/ipc_channel_mojo.h" | 5 #include "ipc/mojo/ipc_channel_mojo.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/location.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/pickle.h" | 11 #include "base/pickle.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/single_thread_task_runner.h" |
| 13 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
| 15 #include "base/thread_task_runner_handle.h" |
| 14 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 15 #include "ipc/ipc_message.h" | 17 #include "ipc/ipc_message.h" |
| 16 #include "ipc/ipc_test_base.h" | 18 #include "ipc/ipc_test_base.h" |
| 17 #include "ipc/ipc_test_channel_listener.h" | 19 #include "ipc/ipc_test_channel_listener.h" |
| 18 #include "ipc/mojo/ipc_channel_mojo_host.h" | 20 #include "ipc/mojo/ipc_channel_mojo_host.h" |
| 19 #include "ipc/mojo/ipc_mojo_handle_attachment.h" | 21 #include "ipc/mojo/ipc_mojo_handle_attachment.h" |
| 20 #include "ipc/mojo/ipc_mojo_message_helper.h" | 22 #include "ipc/mojo/ipc_mojo_message_helper.h" |
| 21 #include "ipc/mojo/ipc_mojo_param_traits.h" | 23 #include "ipc/mojo/ipc_mojo_param_traits.h" |
| 22 #include "ipc/mojo/scoped_ipc_support.h" | 24 #include "ipc/mojo/scoped_ipc_support.h" |
| 23 | 25 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 74 } |
| 73 | 75 |
| 74 void Connect() { | 76 void Connect() { |
| 75 CHECK(channel_->Connect()); | 77 CHECK(channel_->Connect()); |
| 76 } | 78 } |
| 77 | 79 |
| 78 void Close() { | 80 void Close() { |
| 79 channel_->Close(); | 81 channel_->Close(); |
| 80 | 82 |
| 81 base::RunLoop run_loop; | 83 base::RunLoop run_loop; |
| 82 base::MessageLoop::current()->PostTask(FROM_HERE, run_loop.QuitClosure()); | 84 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| 85 run_loop.QuitClosure()); |
| 83 run_loop.Run(); | 86 run_loop.Run(); |
| 84 } | 87 } |
| 85 | 88 |
| 86 IPC::ChannelMojo* channel() const { return channel_.get(); } | 89 IPC::ChannelMojo* channel() const { return channel_.get(); } |
| 87 | 90 |
| 88 private: | 91 private: |
| 89 base::MessageLoopForIO main_message_loop_; | 92 base::MessageLoopForIO main_message_loop_; |
| 90 scoped_ptr<IPC::ChannelMojo> channel_; | 93 scoped_ptr<IPC::ChannelMojo> channel_; |
| 91 }; | 94 }; |
| 92 | 95 |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 base::MessageLoop::current()->Run(); | 777 base::MessageLoop::current()->Run(); |
| 775 | 778 |
| 776 client.Close(); | 779 client.Close(); |
| 777 | 780 |
| 778 return 0; | 781 return 0; |
| 779 } | 782 } |
| 780 | 783 |
| 781 #endif // OS_LINUX | 784 #endif // OS_LINUX |
| 782 | 785 |
| 783 } // namespace | 786 } // namespace |
| OLD | NEW |