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

Side by Side Diff: ipc/ipc_channel_posix.cc

Issue 7486007: Fix NamedProxyLauncher on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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_channel_posix.h ('k') | ipc/ipc_channel_posix_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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ipc/ipc_channel_posix.h" 5 #include "ipc/ipc_channel_posix.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 986
987 // Close any outstanding, received file descriptors. 987 // Close any outstanding, received file descriptors.
988 for (std::vector<int>::iterator 988 for (std::vector<int>::iterator
989 i = input_overflow_fds_.begin(); i != input_overflow_fds_.end(); ++i) { 989 i = input_overflow_fds_.begin(); i != input_overflow_fds_.end(); ++i) {
990 if (HANDLE_EINTR(close(*i)) < 0) 990 if (HANDLE_EINTR(close(*i)) < 0)
991 PLOG(ERROR) << "close"; 991 PLOG(ERROR) << "close";
992 } 992 }
993 input_overflow_fds_.clear(); 993 input_overflow_fds_.clear();
994 } 994 }
995 995
996 // static
997 bool Channel::ChannelImpl::IsNamedServerInitialized(
998 const std::string& channel_id) {
999 return file_util::PathExists(FilePath(channel_id));
1000 }
1001
996 // Called by libevent when we can read from the pipe without blocking. 1002 // Called by libevent when we can read from the pipe without blocking.
997 void Channel::ChannelImpl::OnFileCanReadWithoutBlocking(int fd) { 1003 void Channel::ChannelImpl::OnFileCanReadWithoutBlocking(int fd) {
998 bool send_server_hello_msg = false; 1004 bool send_server_hello_msg = false;
999 if (fd == server_listen_pipe_) { 1005 if (fd == server_listen_pipe_) {
1000 int new_pipe = 0; 1006 int new_pipe = 0;
1001 if (!ServerAcceptConnection(server_listen_pipe_, &new_pipe)) { 1007 if (!ServerAcceptConnection(server_listen_pipe_, &new_pipe)) {
1002 Close(); 1008 Close();
1003 listener_->OnChannelListenError(); 1009 listener_->OnChannelListenError();
1004 } 1010 }
1005 1011
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 } 1201 }
1196 1202
1197 bool Channel::GetClientEuid(uid_t* client_euid) const { 1203 bool Channel::GetClientEuid(uid_t* client_euid) const {
1198 return channel_impl_->GetClientEuid(client_euid); 1204 return channel_impl_->GetClientEuid(client_euid);
1199 } 1205 }
1200 1206
1201 void Channel::ResetToAcceptingConnectionState() { 1207 void Channel::ResetToAcceptingConnectionState() {
1202 channel_impl_->ResetToAcceptingConnectionState(); 1208 channel_impl_->ResetToAcceptingConnectionState();
1203 } 1209 }
1204 1210
1211 // static
1212 bool Channel::IsNamedServerInitialized(const std::string& channel_id) {
1213 return ChannelImpl::IsNamedServerInitialized(channel_id);
1214 }
1215
1205 } // namespace IPC 1216 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix.h ('k') | ipc/ipc_channel_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698