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

Side by Side Diff: ipc/ipc_channel_factory.h

Issue 12386010: Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments for unix_domain_socket_util Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef IPC_IPC_CHANNEL_FACTORY_H_
6 #define IPC_IPC_CHANNEL_FACTORY_H_
7
8 #include "base/files/file_path.h"
9 #include "base/message_loop.h"
10 #include "ipc/ipc_channel_handle.h"
11
12 namespace IPC {
13
14 class ChannelFactory : public MessageLoopForIO::Watcher {
15 public:
16 class Delegate {
17 public:
18 // Called when a client connects to the factory.
19 virtual void OnClientConnected(const ChannelHandle& handle) = 0;
20 };
21
22 ChannelFactory(const std::string& path, Delegate* delegate);
23
24 bool Listen();
25 private:
26 bool CreatePipe();
27 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
28 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {}
29
30 MessageLoopForIO::FileDescriptorWatcher server_listen_connection_watcher_;
31 base::FilePath path_;
32 Delegate* delegate_;
33 int listen_pipe_;
34
35 DISALLOW_COPY_AND_ASSIGN(ChannelFactory);
36 };
37
38 }
39
40 #endif // IPC_IPC_CHANNEL_FACTORY_H_
OLDNEW
« ipc/ipc.gypi ('K') | « ipc/ipc.gypi ('k') | ipc/ipc_channel_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698