diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-13 19:19:36 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-13 19:19:36 +0000 |
commit | c1afbd2c74edf09456ce6a747d4a0a8f746a6685 (patch) | |
tree | f8f76297e6b26ab81811158daee61a66d6c7c962 /chrome/common/ipc_channel.h | |
parent | 2dd6eb4df9d17a30e7a59a44ba5fbaa7c0046466 (diff) | |
download | chromium_src-c1afbd2c74edf09456ce6a747d4a0a8f746a6685.zip chromium_src-c1afbd2c74edf09456ce6a747d4a0a8f746a6685.tar.gz chromium_src-c1afbd2c74edf09456ce6a747d4a0a8f746a6685.tar.bz2 |
Remove WatchObject from the ipc channel.
Review URL: http://codereview.chromium.org/6031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_channel.h')
-rw-r--r-- | chrome/common/ipc_channel.h | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/chrome/common/ipc_channel.h b/chrome/common/ipc_channel.h index 331dac6..e3e4ca2 100644 --- a/chrome/common/ipc_channel.h +++ b/chrome/common/ipc_channel.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_CHANNEL_H__ -#define CHROME_COMMON_IPC_CHANNEL_H__ +#ifndef CHROME_COMMON_IPC_CHANNEL_H_ +#define CHROME_COMMON_IPC_CHANNEL_H_ #include <queue> @@ -14,7 +14,7 @@ namespace IPC { //------------------------------------------------------------------------------ -class Channel : public MessageLoopForIO::Watcher, +class Channel : public MessageLoopForIO::IOHandler, public Message::Sender { // Security tests need access to the pipe handle. friend class ChannelTest; @@ -50,16 +50,13 @@ class Channel : public MessageLoopForIO::Watcher, // Initialize a Channel. // - // @param channel_id - // Identifies the communication Channel. - // @param mode - // Specifies whether this Channel is to operate in server mode or client - // mode. In server mode, the Channel is responsible for setting up the - // IPC object, whereas in client mode, the Channel merely connects - // to the already established IPC object. - // @param listener - // Receives a callback on the current thread for each newly received - // message. + // |channel_id| identifies the communication Channel. + // |mode| specifies whether this Channel is to operate in server mode or + // client mode. In server mode, the Channel is responsible for setting up the + // IPC object, whereas in client mode, the Channel merely connects to the + // already established IPC object. + // |listener| receives a callback on the current thread for each newly + // received message. // Channel(const std::wstring& channel_id, Mode mode, Listener* listener); @@ -80,9 +77,8 @@ class Channel : public MessageLoopForIO::Watcher, // Send a message over the Channel to the listener on the other end. // - // @param message - // The Message to send, which must be allocated using operator new. This - // object will be deleted once the contents of the Message have been sent. + // |message| must be allocated using operator new. This object will be + // deleted once the contents of the Message have been sent. // // FIXME bug 551500: the channel does not notice failures, so if the // renderer crashes, it will silently succeed, leaking the parameter. @@ -103,11 +99,12 @@ class Channel : public MessageLoopForIO::Watcher, const std::wstring PipeName(const std::wstring& channel_id) const; bool CreatePipe(const std::wstring& channel_id, Mode mode); bool ProcessConnection(); - bool ProcessIncomingMessages(); - bool ProcessOutgoingMessages(); + bool ProcessIncomingMessages(OVERLAPPED* context, DWORD bytes_read); + bool ProcessOutgoingMessages(OVERLAPPED* context, DWORD bytes_written); - // MessageLoop::Watcher implementation - virtual void OnObjectSignaled(HANDLE object); + // MessageLoop::IOHandler implementation. + virtual void OnIOCompleted(OVERLAPPED* context, DWORD bytes_transfered, + DWORD error); private: enum { @@ -147,6 +144,8 @@ class Channel : public MessageLoopForIO::Watcher, // problems. TODO(darin): make this unnecessary bool processing_incoming_; + ScopedRunnableMethodFactory<Channel> factory_; + // The Hello message is internal to the Channel class. It is sent // by the peer when the channel is connected. The message contains // just the process id (pid). The message has a special routing_id @@ -161,5 +160,5 @@ class Channel : public MessageLoopForIO::Watcher, } -#endif // CHROME_COMMON_IPC_CHANNEL_H__ +#endif // CHROME_COMMON_IPC_CHANNEL_H_ |