1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_IPC_UTIL_H_
6 #define REMOTING_HOST_IPC_UTIL_H_
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "ipc/ipc_platform_file.h"
17 #include "base/win/scoped_handle.h"
18 #endif // defined(OS_WIN)
22 class SingleThreadTaskRunner
;
32 // Creates an already connected IPC channel. The server end of the channel
33 // is wrapped into a channel proxy that will invoke methods of |listener|
34 // on the caller's thread while using |io_task_runner| to send and receive
35 // messages in the background. The client end is returned as a pipe handle
36 // (inheritable on Windows).
37 bool CreateConnectedIpcChannel(
38 scoped_refptr
<base::SingleThreadTaskRunner
> io_task_runner
,
39 IPC::Listener
* listener
,
40 base::File
* client_out
,
41 scoped_ptr
<IPC::ChannelProxy
>* server_out
);
45 // Creates the server end of the IPC channel and applies the security
46 // descriptor |pipe_security_descriptor| to it.
47 bool CreateIpcChannel(
48 const std::string
& channel_name
,
49 const std::string
& pipe_security_descriptor
,
50 base::win::ScopedHandle
* pipe_out
);
52 #endif // defined(OS_WIN)
54 } // namespace remoting
56 #endif // REMOTING_HOST_IPC_UTIL_H_