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

Side by Side Diff: ipc/ipc_send_fds_test.cc

Issue 310293002: Make IPC::Channel polymorphic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another attempt to fix build breakage Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_message.h ('k') | ipc/ipc_sync_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_POSIX) 7 #if defined(OS_POSIX)
8 #if defined(OS_MACOSX) 8 #if defined(OS_MACOSX)
9 extern "C" { 9 extern "C" {
10 #include <sandbox.h> 10 #include <sandbox.h>
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 int fds_to_send) : 227 int fds_to_send) :
228 in_thread_(in_thread), 228 in_thread_(in_thread),
229 out_thread_(out_thread), 229 out_thread_(out_thread),
230 cb_listener_(cb, fds_to_send), 230 cb_listener_(cb, fds_to_send),
231 null_listener_(base::Bind(&null_cb), 0) { 231 null_listener_(base::Bind(&null_cb), 0) {
232 } 232 }
233 233
234 void Init() { 234 void Init() {
235 IPC::ChannelHandle in_handle("IN"); 235 IPC::ChannelHandle in_handle("IN");
236 in = IPC::Channel::CreateServer(in_handle, &null_listener_); 236 in = IPC::Channel::CreateServer(in_handle, &null_listener_);
237 base::FileDescriptor out_fd(in->TakeClientFileDescriptor(), false); 237 base::FileDescriptor out_fd(
238 in->TakeClientFileDescriptor(), false);
238 IPC::ChannelHandle out_handle("OUT", out_fd); 239 IPC::ChannelHandle out_handle("OUT", out_fd);
239 out = IPC::Channel::CreateClient(out_handle, &cb_listener_); 240 out = IPC::Channel::CreateClient(out_handle, &cb_listener_);
240 // PostTask the connect calls to make sure the callbacks happens 241 // PostTask the connect calls to make sure the callbacks happens
241 // on the right threads. 242 // on the right threads.
242 in_thread_->message_loop()->PostTask( 243 in_thread_->message_loop()->PostTask(
243 FROM_HERE, 244 FROM_HERE,
244 base::Bind(&PipeChannelHelper::Connect, in.get())); 245 base::Bind(&PipeChannelHelper::Connect, in.get()));
245 out_thread_->message_loop()->PostTask( 246 out_thread_->message_loop()->PostTask(
246 FROM_HERE, 247 FROM_HERE,
247 base::Bind(&PipeChannelHelper::Connect, out.get())); 248 base::Bind(&PipeChannelHelper::Connect, out.get()));
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 base::WaitableEvent received_; 368 base::WaitableEvent received_;
368 }; 369 };
369 370
370 TEST_F(IPCMultiSendingFdsTest, StressTest) { 371 TEST_F(IPCMultiSendingFdsTest, StressTest) {
371 Run(); 372 Run();
372 } 373 }
373 374
374 } // namespace 375 } // namespace
375 376
376 #endif // defined(OS_POSIX) 377 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « ipc/ipc_message.h ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698