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 "base/lazy_instance.h" | 5 #include "base/lazy_instance.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "ipc/ipc_perftest_support.h" | 7 #include "ipc/ipc_perftest_support.h" |
8 #include "ipc/mojo/ipc_channel_mojo.h" | 8 #include "ipc/mojo/ipc_channel_mojo.h" |
9 #include "ipc/mojo/ipc_channel_mojo_host.h" | 9 #include "ipc/mojo/ipc_channel_mojo_host.h" |
10 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" | 10 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 void TearDown() override { | 33 void TearDown() override { |
34 IPC::test::IPCChannelPerfTestBase::TearDown(); | 34 IPC::test::IPCChannelPerfTestBase::TearDown(); |
35 } | 35 } |
36 | 36 |
37 scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( | 37 scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( |
38 const IPC::ChannelHandle& handle, | 38 const IPC::ChannelHandle& handle, |
39 base::SequencedTaskRunner* runner) override { | 39 base::SequencedTaskRunner* runner) override { |
40 host_.reset(new IPC::ChannelMojoHost(runner)); | 40 host_.reset(new IPC::ChannelMojoHost(runner)); |
41 return IPC::ChannelMojo::CreateServerFactory(host_->channel_delegate(), | 41 return IPC::ChannelMojo::CreateServerFactory(host_->channel_delegate(), |
42 runner, handle); | 42 runner, handle, nullptr); |
43 } | 43 } |
44 | 44 |
45 bool DidStartClient() override { | 45 bool DidStartClient() override { |
46 bool ok = IPCTestBase::DidStartClient(); | 46 bool ok = IPCTestBase::DidStartClient(); |
47 DCHECK(ok); | 47 DCHECK(ok); |
48 host_->OnClientLaunched(client_process().Handle()); | 48 host_->OnClientLaunched(client_process().Handle()); |
49 return ok; | 49 return ok; |
50 } | 50 } |
51 | 51 |
52 private: | 52 private: |
(...skipping 29 matching lines...) Expand all Loading... |
82 }; | 82 }; |
83 | 83 |
84 MojoTestClient::MojoTestClient() { | 84 MojoTestClient::MojoTestClient() { |
85 g_mojo_initializer.Get(); | 85 g_mojo_initializer.Get(); |
86 } | 86 } |
87 | 87 |
88 scoped_ptr<IPC::Channel> MojoTestClient::CreateChannel( | 88 scoped_ptr<IPC::Channel> MojoTestClient::CreateChannel( |
89 IPC::Listener* listener) { | 89 IPC::Listener* listener) { |
90 return scoped_ptr<IPC::Channel>(IPC::ChannelMojo::Create( | 90 return scoped_ptr<IPC::Channel>(IPC::ChannelMojo::Create( |
91 NULL, task_runner(), IPCTestBase::GetChannelName("PerformanceClient"), | 91 NULL, task_runner(), IPCTestBase::GetChannelName("PerformanceClient"), |
92 IPC::Channel::MODE_CLIENT, listener)); | 92 IPC::Channel::MODE_CLIENT, listener, nullptr)); |
93 } | 93 } |
94 | 94 |
95 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(PerformanceClient) { | 95 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(PerformanceClient) { |
96 MojoTestClient client; | 96 MojoTestClient client; |
97 int rv = client.RunMain(); | 97 int rv = client.RunMain(); |
98 | 98 |
99 base::RunLoop run_loop; | 99 base::RunLoop run_loop; |
100 run_loop.RunUntilIdle(); | 100 run_loop.RunUntilIdle(); |
101 | 101 |
102 return rv; | 102 return rv; |
103 } | 103 } |
104 | 104 |
105 } // namespace | 105 } // namespace |
OLD | NEW |