| 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 } | 617 } |
| 618 | 618 |
| 619 void RegisterInterfaceFactory(IPC::Channel* channel) { | 619 void RegisterInterfaceFactory(IPC::Channel* channel) { |
| 620 channel->GetAssociatedInterfaceSupport()->AddAssociatedInterface( | 620 channel->GetAssociatedInterfaceSupport()->AddAssociatedInterface( |
| 621 base::Bind(&ListenerWithSimpleAssociatedInterface::BindRequest, | 621 base::Bind(&ListenerWithSimpleAssociatedInterface::BindRequest, |
| 622 base::Unretained(this))); | 622 base::Unretained(this))); |
| 623 } | 623 } |
| 624 | 624 |
| 625 private: | 625 private: |
| 626 // IPC::mojom::SimpleTestDriver: | 626 // IPC::mojom::SimpleTestDriver: |
| 627 void ExpectString(const std::string& str) override { | 627 void ExpectString(const mojo::String& str) override { |
| 628 next_expected_string_ = str; | 628 next_expected_string_ = str; |
| 629 } | 629 } |
| 630 | 630 |
| 631 void RequestQuit(const RequestQuitCallback& callback) override { | 631 void RequestQuit(const RequestQuitCallback& callback) override { |
| 632 EXPECT_EQ(kNumMessages, num_messages_received_); | 632 EXPECT_EQ(kNumMessages, num_messages_received_); |
| 633 received_quit_ = true; | 633 received_quit_ = true; |
| 634 callback.Run(); | 634 callback.Run(); |
| 635 base::MessageLoop::current()->QuitWhenIdle(); | 635 base::MessageLoop::current()->QuitWhenIdle(); |
| 636 } | 636 } |
| 637 | 637 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 base::Bind(&ListenerWithSimpleProxyAssociatedInterface::BindRequest, | 794 base::Bind(&ListenerWithSimpleProxyAssociatedInterface::BindRequest, |
| 795 base::Unretained(this))); | 795 base::Unretained(this))); |
| 796 } | 796 } |
| 797 | 797 |
| 798 bool received_all_messages() const { | 798 bool received_all_messages() const { |
| 799 return num_messages_received_ == kNumMessages && received_quit_; | 799 return num_messages_received_ == kNumMessages && received_quit_; |
| 800 } | 800 } |
| 801 | 801 |
| 802 private: | 802 private: |
| 803 // IPC::mojom::SimpleTestDriver: | 803 // IPC::mojom::SimpleTestDriver: |
| 804 void ExpectString(const std::string& str) override { | 804 void ExpectString(const mojo::String& str) override { |
| 805 next_expected_string_ = str; | 805 next_expected_string_ = str; |
| 806 } | 806 } |
| 807 | 807 |
| 808 void RequestQuit(const RequestQuitCallback& callback) override { | 808 void RequestQuit(const RequestQuitCallback& callback) override { |
| 809 received_quit_ = true; | 809 received_quit_ = true; |
| 810 callback.Run(); | 810 callback.Run(); |
| 811 binding_.Close(); | 811 binding_.Close(); |
| 812 base::MessageLoop::current()->QuitWhenIdle(); | 812 base::MessageLoop::current()->QuitWhenIdle(); |
| 813 } | 813 } |
| 814 | 814 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 Connect(&listener); | 1044 Connect(&listener); |
| 1045 | 1045 |
| 1046 base::MessageLoop::current()->Run(); | 1046 base::MessageLoop::current()->Run(); |
| 1047 | 1047 |
| 1048 Close(); | 1048 Close(); |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 #endif // OS_LINUX | 1051 #endif // OS_LINUX |
| 1052 | 1052 |
| 1053 } // namespace | 1053 } // namespace |
| OLD | NEW |