diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-01 23:48:34 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-01 23:48:34 +0000 |
commit | dc90da2c3f8c87baa8dcea7fbf0272001d771ecf (patch) | |
tree | 99baf8465918e25521eab024315a5aa9ce78734d /chrome/common/ipc_channel.h | |
parent | bf1b47dfbe8294738c0db628af036e2fd363ddac (diff) | |
download | chromium_src-dc90da2c3f8c87baa8dcea7fbf0272001d771ecf.zip chromium_src-dc90da2c3f8c87baa8dcea7fbf0272001d771ecf.tar.gz chromium_src-dc90da2c3f8c87baa8dcea7fbf0272001d771ecf.tar.bz2 |
* Add ipc_tests unittest target to xcode project.
* Stub out ipc_channel_posix.cc to allow other code that depends on it to be compiled.
* Cleanup some ipc code a bit to compile on gcc.
* Remove unused IPC::Channel::ProcessPendingMessages()
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_channel.h')
-rw-r--r-- | chrome/common/ipc_channel.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/chrome/common/ipc_channel.h b/chrome/common/ipc_channel.h index b69f962..4709166 100644 --- a/chrome/common/ipc_channel.h +++ b/chrome/common/ipc_channel.h @@ -14,8 +14,11 @@ namespace IPC { //------------------------------------------------------------------------------ -class Channel : public MessageLoopForIO::IOHandler, - public Message::Sender { +class Channel : public Message::Sender +#if defined(OS_WIN) + , public MessageLoopForIO::IOHandler +#endif + { // Security tests need access to the pipe handle. friend class ChannelTest; @@ -86,16 +89,8 @@ class Channel : public MessageLoopForIO::IOHandler, // virtual bool Send(Message* message); - // Process any pending incoming and outgoing messages. Wait for at most - // max_wait_msec for pending messages if there are none. Returns true if - // there were no pending messages or if pending messages were successfully - // processed. Returns false if there are pending messages that cannot be - // processed for some reason (e.g., because ProcessIncomingMessages would be - // re-entered). - // TODO(darin): Need a better way of dealing with the recursion problem. - bool ProcessPendingMessages(DWORD max_wait_msec); - private: +#if defined(OS_WIN) const std::wstring PipeName(const std::wstring& channel_id) const; bool CreatePipe(const std::wstring& channel_id, Mode mode); bool ProcessConnection(); @@ -107,12 +102,14 @@ class Channel : public MessageLoopForIO::IOHandler, // MessageLoop::IOHandler implementation. virtual void OnIOCompleted(MessageLoopForIO::IOContext* context, DWORD bytes_transfered, DWORD error); +#endif private: enum { BUF_SIZE = 4096 }; +#if defined(OS_WIN) struct State { explicit State(Channel* channel); ~State(); @@ -124,6 +121,7 @@ class Channel : public MessageLoopForIO::IOHandler, State output_state_; HANDLE pipe_; +#endif Listener* listener_; // Messages to be sent are queued here. @@ -153,10 +151,10 @@ class Channel : public MessageLoopForIO::IOHandler, // just the process id (pid). The message has a special routing_id // (MSG_ROUTING_NONE) and type (HELLO_MESSAGE_TYPE). enum { - HELLO_MESSAGE_TYPE = MAXWORD // Maximum value of message type (WORD), - // to avoid conflicting with normal - // message types, which are enumeration - // constants starting from 0. + HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), + // to avoid conflicting with normal + // message types, which are enumeration + // constants starting from 0. }; }; |