summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_posix.h
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-03 02:29:45 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-03 02:29:45 +0000
commit82e5ee816a5f05d230c5356205e93d803650d0b9 (patch)
tree6b6e9d1bef407feef8ef24eedc9f343e2d536609 /ipc/ipc_channel_posix.h
parent8cf3f1dae79db8cfbf9dc6b75c140eabad918a6e (diff)
downloadchromium_src-82e5ee816a5f05d230c5356205e93d803650d0b9.zip
chromium_src-82e5ee816a5f05d230c5356205e93d803650d0b9.tar.gz
chromium_src-82e5ee816a5f05d230c5356205e93d803650d0b9.tar.bz2
Revert "Move IPC code to ipc/"
This reverts commit r13062 which, unsurprisingly, broke the build. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13063 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_posix.h')
-rw-r--r--ipc/ipc_channel_posix.h112
1 files changed, 0 insertions, 112 deletions
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
deleted file mode 100644
index 53fba1b9..0000000
--- a/ipc/ipc_channel_posix.h
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) 2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef IPC_IPC_CHANNEL_POSIX_H_
-#define IPC_IPC_CHANNEL_POSIX_H_
-
-#include "ipc/ipc_channel.h"
-
-#include <sys/socket.h> // for CMSG macros
-
-#include <queue>
-#include <string>
-#include <vector>
-
-#include "base/message_loop.h"
-#include "ipc/file_descriptor_set_posix.h"
-
-namespace IPC {
-
-class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
- public:
- // Mirror methods of Channel, see ipc_channel.h for description.
- ChannelImpl(const std::wstring& channel_id, Mode mode, Listener* listener);
- ~ChannelImpl() { Close(); }
- bool Connect();
- void Close();
- void set_listener(Listener* listener) { listener_ = listener; }
- bool Send(Message* message);
- void GetClientFileDescriptorMapping(int *src_fd, int *dest_fd);
- void OnClientConnected();
-
- private:
- const std::wstring PipeName(const std::wstring& channel_id) const;
- bool CreatePipe(const std::wstring& channel_id, Mode mode);
-
- bool ProcessIncomingMessages();
- bool ProcessOutgoingMessages();
-
- void OnFileCanReadWithoutBlocking(int fd);
- void OnFileCanWriteWithoutBlocking(int fd);
-
- Mode mode_;
-
- // After accepting one client connection on our server socket we want to
- // stop listening.
- MessageLoopForIO::FileDescriptorWatcher server_listen_connection_watcher_;
- MessageLoopForIO::FileDescriptorWatcher read_watcher_;
- MessageLoopForIO::FileDescriptorWatcher write_watcher_;
-
- // Indicates whether we're currently blocked waiting for a write to complete.
- bool is_blocked_on_write_;
-
- // If sending a message blocks then we use this variable
- // to keep track of where we are.
- size_t message_send_bytes_written_;
-
- // If the kTestingChannelID flag is specified, we use a FIFO instead of
- // a socketpair().
- bool uses_fifo_;
-
- int server_listen_pipe_;
- int pipe_;
- int client_pipe_; // The client end of our socketpair().
- std::string pipe_name_;
-
- Listener* listener_;
-
- // Messages to be sent are queued here.
- std::queue<Message*> output_queue_;
-
- // We read from the pipe into this buffer
- char input_buf_[Channel::kReadBufferSize];
-
- enum {
- // We assume a worst case: kReadBufferSize bytes of messages, where each
- // message has no payload and a full complement of descriptors.
- MAX_READ_FDS = (Channel::kReadBufferSize / sizeof(IPC::Message::Header)) *
- FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE,
- };
-
- // This is a control message buffer large enough to hold kMaxReadFDs
-#if defined(OS_MACOSX)
- // TODO(agl): OSX appears to have non-constant CMSG macros!
- char input_cmsg_buf_[1024];
-#else
- char input_cmsg_buf_[CMSG_SPACE(sizeof(int) * MAX_READ_FDS)];
-#endif
-
- // Large messages that span multiple pipe buffers, get built-up using
- // this buffer.
- std::string input_overflow_buf_;
- std::vector<int> input_overflow_fds_;
-
- // In server-mode, we have to wait for the client to connect before we
- // can begin reading. We make use of the input_state_ when performing
- // the connect operation in overlapped mode.
- bool waiting_connect_;
-
- // This flag is set when processing incoming messages. It is used to
- // avoid recursing through ProcessIncomingMessages, which could cause
- // problems. TODO(darin): make this unnecessary
- bool processing_incoming_;
-
- ScopedRunnableMethodFactory<ChannelImpl> factory_;
-
- DISALLOW_COPY_AND_ASSIGN(ChannelImpl);
-};
-
-} // namespace IPC
-
-#endif // IPC_IPC_CHANNEL_POSIX_H_