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

Unified Diff: apps/app_shim/unix_domain_socket_acceptor.cc

Issue 305973002: Rename IPC::ChannelFactory to ChannelHandleAcceptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/app_shim/unix_domain_socket_acceptor.h ('k') | ipc/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_shim/unix_domain_socket_acceptor.cc
diff --git a/ipc/ipc_channel_factory.cc b/apps/app_shim/unix_domain_socket_acceptor.cc
similarity index 65%
rename from ipc/ipc_channel_factory.cc
rename to apps/app_shim/unix_domain_socket_acceptor.cc
index 244024c2f6dcf42bb0b8288ed3298b0547a6857e..e31d5595e0ae97c87aa83b2e6b05c624afbe84f4 100644
--- a/ipc/ipc_channel_factory.cc
+++ b/apps/app_shim/unix_domain_socket_acceptor.cc
@@ -2,33 +2,34 @@
// 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 "apps/app_shim/unix_domain_socket_acceptor.h"
#include "base/file_util.h"
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "ipc/unix_domain_socket_util.h"
-namespace IPC {
+namespace apps {
-ChannelFactory::ChannelFactory(const base::FilePath& path, Delegate* delegate)
+UnixDomainSocketAcceptor::UnixDomainSocketAcceptor(const base::FilePath& path,
+ Delegate* delegate)
: path_(path), delegate_(delegate), listen_fd_(-1) {
DCHECK(delegate_);
CreateSocket();
}
-ChannelFactory::~ChannelFactory() {
+UnixDomainSocketAcceptor::~UnixDomainSocketAcceptor() {
Close();
}
-bool ChannelFactory::CreateSocket() {
+bool UnixDomainSocketAcceptor::CreateSocket() {
DCHECK(listen_fd_ < 0);
// Create the socket.
- return CreateServerUnixDomainSocket(path_, &listen_fd_);
+ return IPC::CreateServerUnixDomainSocket(path_, &listen_fd_);
}
-bool ChannelFactory::Listen() {
+bool UnixDomainSocketAcceptor::Listen() {
if (listen_fd_ < 0)
return false;
@@ -44,10 +45,10 @@ bool ChannelFactory::Listen() {
}
// Called by libevent when we can read from the fd without blocking.
-void ChannelFactory::OnFileCanReadWithoutBlocking(int fd) {
+void UnixDomainSocketAcceptor::OnFileCanReadWithoutBlocking(int fd) {
DCHECK(fd == listen_fd_);
int new_fd = -1;
- if (!ServerAcceptConnection(listen_fd_, &new_fd)) {
+ if (!IPC::ServerAcceptConnection(listen_fd_, &new_fd)) {
Close();
delegate_->OnListenError();
return;
@@ -61,19 +62,19 @@ void ChannelFactory::OnFileCanReadWithoutBlocking(int fd) {
}
// Verify that the IPC channel peer is running as the same user.
- if (!IsPeerAuthorized(scoped_fd.get()))
+ if (!IPC::IsPeerAuthorized(scoped_fd.get()))
return;
- ChannelHandle handle(std::string(),
- base::FileDescriptor(scoped_fd.release(), true));
+ IPC::ChannelHandle handle(std::string(),
+ base::FileDescriptor(scoped_fd.release(), true));
delegate_->OnClientConnected(handle);
}
-void ChannelFactory::OnFileCanWriteWithoutBlocking(int fd) {
+void UnixDomainSocketAcceptor::OnFileCanWriteWithoutBlocking(int fd) {
NOTREACHED() << "Listen fd should never be writable.";
}
-void ChannelFactory::Close() {
+void UnixDomainSocketAcceptor::Close() {
if (listen_fd_ < 0)
return;
if (IGNORE_EINTR(close(listen_fd_)) < 0)
@@ -86,4 +87,4 @@ void ChannelFactory::Close() {
server_listen_connection_watcher_.StopWatchingFileDescriptor();
}
-} // namespace IPC
+} // namespace apps
« no previous file with comments | « apps/app_shim/unix_domain_socket_acceptor.h ('k') | ipc/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698