Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: ipc/ipc_channel_mojo_unittest.cc

Issue 2183963002: Revert of Mojo C++ bindings: make ipc/ mojom targets to use STL string/vector types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_channel_mojo.cc ('k') | ipc/ipc_message_pipe_reader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 } 621 }
622 622
623 void RegisterInterfaceFactory(IPC::Channel* channel) { 623 void RegisterInterfaceFactory(IPC::Channel* channel) {
624 channel->GetAssociatedInterfaceSupport()->AddAssociatedInterface( 624 channel->GetAssociatedInterfaceSupport()->AddAssociatedInterface(
625 base::Bind(&ListenerWithSimpleAssociatedInterface::BindRequest, 625 base::Bind(&ListenerWithSimpleAssociatedInterface::BindRequest,
626 base::Unretained(this))); 626 base::Unretained(this)));
627 } 627 }
628 628
629 private: 629 private:
630 // IPC::mojom::SimpleTestDriver: 630 // IPC::mojom::SimpleTestDriver:
631 void ExpectString(const std::string& str) override { 631 void ExpectString(const mojo::String& str) override {
632 next_expected_string_ = str; 632 next_expected_string_ = str;
633 } 633 }
634 634
635 void RequestQuit(const RequestQuitCallback& callback) override { 635 void RequestQuit(const RequestQuitCallback& callback) override {
636 EXPECT_EQ(kNumMessages, num_messages_received_); 636 EXPECT_EQ(kNumMessages, num_messages_received_);
637 received_quit_ = true; 637 received_quit_ = true;
638 callback.Run(); 638 callback.Run();
639 base::MessageLoop::current()->QuitWhenIdle(); 639 base::MessageLoop::current()->QuitWhenIdle();
640 } 640 }
641 641
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 base::Bind(&ListenerWithSimpleProxyAssociatedInterface::BindRequest, 798 base::Bind(&ListenerWithSimpleProxyAssociatedInterface::BindRequest,
799 base::Unretained(this))); 799 base::Unretained(this)));
800 } 800 }
801 801
802 bool received_all_messages() const { 802 bool received_all_messages() const {
803 return num_messages_received_ == kNumMessages && received_quit_; 803 return num_messages_received_ == kNumMessages && received_quit_;
804 } 804 }
805 805
806 private: 806 private:
807 // IPC::mojom::SimpleTestDriver: 807 // IPC::mojom::SimpleTestDriver:
808 void ExpectString(const std::string& str) override { 808 void ExpectString(const mojo::String& str) override {
809 next_expected_string_ = str; 809 next_expected_string_ = str;
810 } 810 }
811 811
812 void RequestQuit(const RequestQuitCallback& callback) override { 812 void RequestQuit(const RequestQuitCallback& callback) override {
813 received_quit_ = true; 813 received_quit_ = true;
814 callback.Run(); 814 callback.Run();
815 binding_.Close(); 815 binding_.Close();
816 base::MessageLoop::current()->QuitWhenIdle(); 816 base::MessageLoop::current()->QuitWhenIdle();
817 } 817 }
818 818
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 Connect(&listener); 1048 Connect(&listener);
1049 1049
1050 base::MessageLoop::current()->Run(); 1050 base::MessageLoop::current()->Run();
1051 1051
1052 Close(); 1052 Close();
1053 } 1053 }
1054 1054
1055 #endif // OS_LINUX 1055 #endif // OS_LINUX
1056 1056
1057 } // namespace 1057 } // namespace
OLDNEW
« no previous file with comments | « ipc/ipc_channel_mojo.cc ('k') | ipc/ipc_message_pipe_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698