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

Side by Side Diff: ipc/ipc_sync_channel_unittest.cc

Issue 5513001: Add a base class for objects that want to filter messages on the UI thread. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix possible race condition Created 10 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // Unit test for SyncChannel. 5 // Unit test for SyncChannel.
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 base::Thread* ListenerThread() { 163 base::Thread* ListenerThread() {
164 return overrided_thread_ ? overrided_thread_ : &listener_thread_; 164 return overrided_thread_ ? overrided_thread_ : &listener_thread_;
165 } 165 }
166 166
167 private: 167 private:
168 // Called on the listener thread to create the sync channel. 168 // Called on the listener thread to create the sync channel.
169 void OnStart() { 169 void OnStart() {
170 // Link ipc_thread_, listener_thread_ and channel_ altogether. 170 // Link ipc_thread_, listener_thread_ and channel_ altogether.
171 StartThread(&ipc_thread_, MessageLoop::TYPE_IO); 171 StartThread(&ipc_thread_, MessageLoop::TYPE_IO);
172 channel_.reset(new SyncChannel( 172 channel_.reset(new SyncChannel(
173 channel_name_, mode_, this, NULL, ipc_thread_.message_loop(), true, 173 channel_name_, mode_, this, ipc_thread_.message_loop(), true,
174 &shutdown_event_)); 174 &shutdown_event_));
175 channel_created_->Signal(); 175 channel_created_->Signal();
176 Run(); 176 Run();
177 } 177 }
178 178
179 void OnListenerThreadShutdown1(WaitableEvent* listener_event, 179 void OnListenerThreadShutdown1(WaitableEvent* listener_event,
180 WaitableEvent* ipc_event) { 180 WaitableEvent* ipc_event) {
181 // SyncChannel needs to be destructed on the thread that it was created on. 181 // SyncChannel needs to be destructed on the thread that it was created on.
182 channel_.reset(); 182 channel_.reset();
183 183
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 server.done_event()->Wait(); 1162 server.done_event()->Wait();
1163 server.done_event()->Reset(); 1163 server.done_event()->Reset();
1164 1164
1165 server.SendDummy(); 1165 server.SendDummy();
1166 server.done_event()->Wait(); 1166 server.done_event()->Wait();
1167 1167
1168 EXPECT_FALSE(server.send_result()); 1168 EXPECT_FALSE(server.send_result());
1169 } 1169 }
1170 1170
1171 1171
OLDNEW
« ipc/ipc_channel_proxy.cc ('K') | « ipc/ipc_sync_channel.cc ('k') | ipc/ipc_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698