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

Side by Side Diff: ipc/ipc_test_base.h

Issue 955813002: Make ChannelMojoHost::ChannelDelegate a RefContedThreadSafe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing Created 5 years, 9 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 | « content/browser/renderer_host/render_process_host_impl.cc ('k') | ipc/ipc_test_base.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef IPC_IPC_TEST_BASE_H_ 5 #ifndef IPC_IPC_TEST_BASE_H_
6 #define IPC_IPC_TEST_BASE_H_ 6 #define IPC_IPC_TEST_BASE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // channel or a proxy). 94 // channel or a proxy).
95 IPC::Sender* sender() { 95 IPC::Sender* sender() {
96 return channel_.get() ? static_cast<IPC::Sender*>(channel_.get()) : 96 return channel_.get() ? static_cast<IPC::Sender*>(channel_.get()) :
97 static_cast<IPC::Sender*>(channel_proxy_.get()); 97 static_cast<IPC::Sender*>(channel_proxy_.get());
98 } 98 }
99 99
100 IPC::Channel* channel() { return channel_.get(); } 100 IPC::Channel* channel() { return channel_.get(); }
101 IPC::ChannelProxy* channel_proxy() { return channel_proxy_.get(); } 101 IPC::ChannelProxy* channel_proxy() { return channel_proxy_.get(); }
102 102
103 const base::Process& client_process() const { return client_process_; } 103 const base::Process& client_process() const { return client_process_; }
104 scoped_refptr<base::TaskRunner> task_runner(); 104 scoped_refptr<base::SequencedTaskRunner> task_runner();
105 105
106 virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( 106 virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory(
107 const IPC::ChannelHandle& handle, base::TaskRunner* runner); 107 const IPC::ChannelHandle& handle, base::TaskRunner* runner);
108 108
109 virtual bool DidStartClient(); 109 virtual bool DidStartClient();
110 110
111 private: 111 private:
112 std::string GetTestMainName() const; 112 std::string GetTestMainName() const;
113 113
114 std::string test_client_name_; 114 std::string test_client_name_;
115 scoped_ptr<base::MessageLoop> message_loop_; 115 scoped_ptr<base::MessageLoop> message_loop_;
116 116
117 scoped_ptr<IPC::Channel> channel_; 117 scoped_ptr<IPC::Channel> channel_;
118 scoped_ptr<IPC::ChannelProxy> channel_proxy_; 118 scoped_ptr<IPC::ChannelProxy> channel_proxy_;
119 119
120 base::Process client_process_; 120 base::Process client_process_;
121 121
122 DISALLOW_COPY_AND_ASSIGN(IPCTestBase); 122 DISALLOW_COPY_AND_ASSIGN(IPCTestBase);
123 }; 123 };
124 124
125 // Use this to declare the client side for tests using IPCTestBase. 125 // Use this to declare the client side for tests using IPCTestBase.
126 #define MULTIPROCESS_IPC_TEST_CLIENT_MAIN(test_client_name) \ 126 #define MULTIPROCESS_IPC_TEST_CLIENT_MAIN(test_client_name) \
127 MULTIPROCESS_IPC_TEST_MAIN(test_client_name ## TestClientMain) 127 MULTIPROCESS_IPC_TEST_MAIN(test_client_name ## TestClientMain)
128 128
129 #endif // IPC_IPC_TEST_BASE_H_ 129 #endif // IPC_IPC_TEST_BASE_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | ipc/ipc_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698