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 <stddef.h> | 5 #include <stddef.h> |
6 #include <memory> | 6 #include <memory> |
7 | 7 |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/process/process_metrics.h" | 9 #include "base/process/process_metrics.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 private: | 452 private: |
453 base::MessageLoopForIO main_message_loop_; | 453 base::MessageLoopForIO main_message_loop_; |
454 std::unique_ptr<ChannelReflectorListener> listener_; | 454 std::unique_ptr<ChannelReflectorListener> listener_; |
455 std::unique_ptr<Channel> channel_; | 455 std::unique_ptr<Channel> channel_; |
456 mojo::ScopedMessagePipeHandle handle_; | 456 mojo::ScopedMessagePipeHandle handle_; |
457 }; | 457 }; |
458 | 458 |
459 MULTIPROCESS_TEST_MAIN(MojoPerfTestClientTestChildMain) { | 459 MULTIPROCESS_TEST_MAIN(MojoPerfTestClientTestChildMain) { |
460 MojoPerfTestClient client; | 460 MojoPerfTestClient client; |
461 int rv = mojo::edk::test::MultiprocessTestHelper::RunClientMain( | 461 int rv = mojo::edk::test::MultiprocessTestHelper::RunClientMain( |
462 base::Bind(&MojoPerfTestClient::Run, base::Unretained(&client))); | 462 base::Bind(&MojoPerfTestClient::Run, base::Unretained(&client)), |
| 463 true /* pass_pipe_ownership_to_main */); |
463 | 464 |
464 base::RunLoop run_loop; | 465 base::RunLoop run_loop; |
465 run_loop.RunUntilIdle(); | 466 run_loop.RunUntilIdle(); |
466 | 467 |
467 return rv; | 468 return rv; |
468 } | 469 } |
469 | 470 |
470 class ReflectorImpl : public IPC::mojom::Reflector { | 471 class ReflectorImpl : public IPC::mojom::Reflector { |
471 public: | 472 public: |
472 explicit ReflectorImpl(mojo::ScopedMessagePipeHandle handle) | 473 explicit ReflectorImpl(mojo::ScopedMessagePipeHandle handle) |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 RunSingleThreadPostTaskPingPongServer(); | 772 RunSingleThreadPostTaskPingPongServer(); |
772 } | 773 } |
773 | 774 |
774 // Sends the same data as above without using PostTask to the same thread. | 775 // Sends the same data as above without using PostTask to the same thread. |
775 TEST_F(CallbackPerfTest, SingleThreadNoPostTaskPingPong) { | 776 TEST_F(CallbackPerfTest, SingleThreadNoPostTaskPingPong) { |
776 RunSingleThreadNoPostTaskPingPongServer(); | 777 RunSingleThreadNoPostTaskPingPongServer(); |
777 } | 778 } |
778 | 779 |
779 } // namespace | 780 } // namespace |
780 } // namespace IPC | 781 } // namespace IPC |
OLD | NEW |