summaryrefslogtreecommitdiffstats
path: root/chrome/common/ipc_channel.h
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-09 04:30:47 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-09 04:30:47 +0000
commit2984f1ca64a63ed179348f6a88133e06c117dd8b (patch)
treeedf03eca1ece65cdfd845baa7771147166a0360b /chrome/common/ipc_channel.h
parentefbbc4e910ffc6bfa364b6663143ac39930759fb (diff)
downloadchromium_src-2984f1ca64a63ed179348f6a88133e06c117dd8b.zip
chromium_src-2984f1ca64a63ed179348f6a88133e06c117dd8b.tar.gz
chromium_src-2984f1ca64a63ed179348f6a88133e06c117dd8b.tar.bz2
Switch IPC classes over to using ObjectWatcher instead of MessageLoop::WatchObject.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_channel.h')
-rw-r--r--chrome/common/ipc_channel.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/chrome/common/ipc_channel.h b/chrome/common/ipc_channel.h
index bf71e02..0e63a7b 100644
--- a/chrome/common/ipc_channel.h
+++ b/chrome/common/ipc_channel.h
@@ -27,19 +27,19 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#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>
-#include "base/message_loop.h"
+#include "base/object_watcher.h"
#include "chrome/common/ipc_message.h"
namespace IPC {
//------------------------------------------------------------------------------
-class Channel : public MessageLoop::Watcher,
+class Channel : public base::ObjectWatcher::Delegate,
public Message::Sender {
// Security tests need access to the pipe handle.
friend class ChannelTest;
@@ -113,15 +113,6 @@ class Channel : public MessageLoop::Watcher,
//
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:
const std::wstring PipeName(const std::wstring& channel_id) const;
bool CreatePipe(const std::wstring& channel_id, Mode mode);
@@ -129,10 +120,9 @@ class Channel : public MessageLoop::Watcher,
bool ProcessIncomingMessages();
bool ProcessOutgoingMessages();
- // MessageLoop::Watcher implementation
+ // ObjectWatcher::Delegate implementation
virtual void OnObjectSignaled(HANDLE object);
- private:
enum {
BUF_SIZE = 4096
};
@@ -140,6 +130,7 @@ class Channel : public MessageLoop::Watcher,
struct State {
State();
~State();
+ base::ObjectWatcher watcher;
OVERLAPPED overlapped;
bool is_pending;
};
@@ -184,4 +175,4 @@ class Channel : public MessageLoop::Watcher,
}
-#endif // CHROME_COMMON_IPC_CHANNEL_H__
+#endif // CHROME_COMMON_IPC_CHANNEL_H_