| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 "chrome/common/ipc_channel_posix.h" | 5 #include "chrome/common/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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 } // namespace | 240 } // namespace |
| 241 //------------------------------------------------------------------------------ | 241 //------------------------------------------------------------------------------ |
| 242 | 242 |
| 243 Channel::ChannelImpl::ChannelImpl(const std::wstring& channel_id, Mode mode, | 243 Channel::ChannelImpl::ChannelImpl(const std::wstring& channel_id, Mode mode, |
| 244 Listener* listener) | 244 Listener* listener) |
| 245 : mode_(mode), | 245 : mode_(mode), |
| 246 is_blocked_on_write_(false), | 246 is_blocked_on_write_(false), |
| 247 message_send_bytes_written_(0), | 247 message_send_bytes_written_(0), |
| 248 uses_fifo_(CommandLine::ForCurrentProcess()->HasSwitch( | 248 uses_fifo_(CommandLine::ForCurrentProcess()->HasSwitch( |
| 249 switches::kTestingChannelID)), | 249 switches::kIPCUseFIFO)), |
| 250 server_listen_pipe_(-1), | 250 server_listen_pipe_(-1), |
| 251 pipe_(-1), | 251 pipe_(-1), |
| 252 client_pipe_(-1), | 252 client_pipe_(-1), |
| 253 listener_(listener), | 253 listener_(listener), |
| 254 waiting_connect_(true), | 254 waiting_connect_(true), |
| 255 processing_incoming_(false), | 255 processing_incoming_(false), |
| 256 factory_(this) { | 256 factory_(this) { |
| 257 if (!CreatePipe(channel_id, mode)) { | 257 if (!CreatePipe(channel_id, mode)) { |
| 258 // The pipe may have been closed already. | 258 // The pipe may have been closed already. |
| 259 LOG(WARNING) << "Unable to create pipe named \"" << channel_id << | 259 LOG(WARNING) << "Unable to create pipe named \"" << channel_id << |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 void Channel::GetClientFileDescriptorMapping(int *src_fd, int *dest_fd) { | 804 void Channel::GetClientFileDescriptorMapping(int *src_fd, int *dest_fd) { |
| 805 return channel_impl_->GetClientFileDescriptorMapping(src_fd, dest_fd); | 805 return channel_impl_->GetClientFileDescriptorMapping(src_fd, dest_fd); |
| 806 } | 806 } |
| 807 | 807 |
| 808 void Channel::OnClientConnected() { | 808 void Channel::OnClientConnected() { |
| 809 return channel_impl_->OnClientConnected(); | 809 return channel_impl_->OnClientConnected(); |
| 810 } | 810 } |
| 811 | 811 |
| 812 | 812 |
| 813 } // namespace IPC | 813 } // namespace IPC |
| OLD | NEW |