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

Side by Side Diff: mojo/system/message_pipe_test_utils.cc

Issue 488003003: Add ChannelProxy benchmark to ipc_perftests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing. Created 6 years, 3 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 | « mojo/system/message_pipe_test_utils.h ('k') | mojo/system/raw_channel_unittest.cc » ('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 "mojo/system/message_pipe_test_utils.h" 5 #include "mojo/system/message_pipe_test_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/threading/platform_thread.h" // For |Sleep()|. 8 #include "base/threading/platform_thread.h" // For |Sleep()|.
9 #include "mojo/system/waiter.h" 9 #include "mojo/system/waiter.h"
10 10
(...skipping 13 matching lines...) Expand all
24 : add_result; 24 : add_result;
25 } 25 }
26 26
27 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, NULL); 27 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, NULL);
28 mp->RemoveWaiter(0, &waiter, signals_state); 28 mp->RemoveWaiter(0, &waiter, signals_state);
29 return wait_result; 29 return wait_result;
30 } 30 }
31 31
32 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support) 32 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support)
33 : platform_support_(platform_support), 33 : platform_support_(platform_support),
34 test_io_thread_(test::TestIOThread::kManualStart) { 34 test_io_thread_(base::TestIOThread::kManualStart) {
35 } 35 }
36 36
37 ChannelThread::~ChannelThread() { 37 ChannelThread::~ChannelThread() {
38 Stop(); 38 Stop();
39 } 39 }
40 40
41 void ChannelThread::Start(embedder::ScopedPlatformHandle platform_handle, 41 void ChannelThread::Start(embedder::ScopedPlatformHandle platform_handle,
42 scoped_refptr<MessagePipe> message_pipe) { 42 scoped_refptr<MessagePipe> message_pipe) {
43 test_io_thread_.Start(); 43 test_io_thread_.Start();
44 test_io_thread_.PostTaskAndWait( 44 test_io_thread_.PostTaskAndWait(
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 MultiprocessMessagePipeTestBase::~MultiprocessMessagePipeTestBase() { 101 MultiprocessMessagePipeTestBase::~MultiprocessMessagePipeTestBase() {
102 } 102 }
103 103
104 void MultiprocessMessagePipeTestBase::Init(scoped_refptr<MessagePipe> mp) { 104 void MultiprocessMessagePipeTestBase::Init(scoped_refptr<MessagePipe> mp) {
105 channel_thread_.Start(helper_.server_platform_handle.Pass(), mp); 105 channel_thread_.Start(helper_.server_platform_handle.Pass(), mp);
106 } 106 }
107 107
108 } // namespace test 108 } // namespace test
109 } // namespace system 109 } // namespace system
110 } // namespace mojo 110 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/message_pipe_test_utils.h ('k') | mojo/system/raw_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698