| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace | 159 } // namespace |
| 160 //------------------------------------------------------------------------------ | 160 //------------------------------------------------------------------------------ |
| 161 | 161 |
| 162 Channel::ChannelImpl::ChannelImpl(const std::wstring& channel_id, Mode mode, | 162 Channel::ChannelImpl::ChannelImpl(const std::wstring& channel_id, Mode mode, |
| 163 Listener* listener) | 163 Listener* listener) |
| 164 : mode_(mode), | 164 : mode_(mode), |
| 165 is_blocked_on_write_(false), | 165 is_blocked_on_write_(false), |
| 166 message_send_bytes_written_(0), | 166 message_send_bytes_written_(0), |
| 167 uses_fifo_(CommandLine().HasSwitch(switches::kTestingChannelID)), | 167 uses_fifo_(CommandLine::ForCurrentProcess()->HasSwitch( |
| 168 switches::kTestingChannelID)), |
| 168 server_listen_pipe_(-1), | 169 server_listen_pipe_(-1), |
| 169 pipe_(-1), | 170 pipe_(-1), |
| 170 client_pipe_(-1), | 171 client_pipe_(-1), |
| 171 listener_(listener), | 172 listener_(listener), |
| 172 waiting_connect_(true), | 173 waiting_connect_(true), |
| 173 processing_incoming_(false), | 174 processing_incoming_(false), |
| 174 factory_(this) { | 175 factory_(this) { |
| 175 if (!CreatePipe(channel_id, mode)) { | 176 if (!CreatePipe(channel_id, mode)) { |
| 176 // The pipe may have been closed already. | 177 // The pipe may have been closed already. |
| 177 LOG(WARNING) << "Unable to create pipe named \"" << channel_id << | 178 LOG(WARNING) << "Unable to create pipe named \"" << channel_id << |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 void Channel::GetClientFileDescriptorMapping(int *src_fd, int *dest_fd) { | 561 void Channel::GetClientFileDescriptorMapping(int *src_fd, int *dest_fd) { |
| 561 return channel_impl_->GetClientFileDescriptorMapping(src_fd, dest_fd); | 562 return channel_impl_->GetClientFileDescriptorMapping(src_fd, dest_fd); |
| 562 } | 563 } |
| 563 | 564 |
| 564 void Channel::OnClientConnected() { | 565 void Channel::OnClientConnected() { |
| 565 return channel_impl_->OnClientConnected(); | 566 return channel_impl_->OnClientConnected(); |
| 566 } | 567 } |
| 567 | 568 |
| 568 | 569 |
| 569 } // namespace IPC | 570 } // namespace IPC |
| OLD | NEW |