Index: ipc/ipc_channel_handle_acceptor.cc |
diff --git a/ipc/ipc_channel_factory.cc b/ipc/ipc_channel_handle_acceptor.cc |
similarity index 80% |
rename from ipc/ipc_channel_factory.cc |
rename to ipc/ipc_channel_handle_acceptor.cc |
index 244024c2f6dcf42bb0b8288ed3298b0547a6857e..78f0fdf051c9412c5f985ce3d4451ba1a9e8a5fb 100644 |
--- a/ipc/ipc_channel_factory.cc |
+++ b/ipc/ipc_channel_handle_acceptor.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "ipc/ipc_channel_factory.h" |
+#include "ipc/ipc_channel_handle_acceptor.h" |
#include "base/file_util.h" |
#include "base/files/scoped_file.h" |
@@ -11,24 +11,25 @@ |
namespace IPC { |
-ChannelFactory::ChannelFactory(const base::FilePath& path, Delegate* delegate) |
+ChannelHandleAcceptor::ChannelHandleAcceptor(const base::FilePath& path, |
+ Delegate* delegate) |
: path_(path), delegate_(delegate), listen_fd_(-1) { |
DCHECK(delegate_); |
CreateSocket(); |
} |
-ChannelFactory::~ChannelFactory() { |
+ChannelHandleAcceptor::~ChannelHandleAcceptor() { |
Close(); |
} |
-bool ChannelFactory::CreateSocket() { |
+bool ChannelHandleAcceptor::CreateSocket() { |
DCHECK(listen_fd_ < 0); |
// Create the socket. |
return CreateServerUnixDomainSocket(path_, &listen_fd_); |
} |
-bool ChannelFactory::Listen() { |
+bool ChannelHandleAcceptor::Listen() { |
if (listen_fd_ < 0) |
return false; |
@@ -44,7 +45,7 @@ bool ChannelFactory::Listen() { |
} |
// Called by libevent when we can read from the fd without blocking. |
-void ChannelFactory::OnFileCanReadWithoutBlocking(int fd) { |
+void ChannelHandleAcceptor::OnFileCanReadWithoutBlocking(int fd) { |
DCHECK(fd == listen_fd_); |
int new_fd = -1; |
if (!ServerAcceptConnection(listen_fd_, &new_fd)) { |
@@ -69,11 +70,11 @@ void ChannelFactory::OnFileCanReadWithoutBlocking(int fd) { |
delegate_->OnClientConnected(handle); |
} |
-void ChannelFactory::OnFileCanWriteWithoutBlocking(int fd) { |
+void ChannelHandleAcceptor::OnFileCanWriteWithoutBlocking(int fd) { |
NOTREACHED() << "Listen fd should never be writable."; |
} |
-void ChannelFactory::Close() { |
+void ChannelHandleAcceptor::Close() { |
if (listen_fd_ < 0) |
return; |
if (IGNORE_EINTR(close(listen_fd_)) < 0) |