Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(861)

Unified Diff: chrome/common/ipc_sync_message.h

Issue 16554: WaitableEvent (Closed)
Patch Set: Addresssing darin's comments (round 2) Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/ipc_sync_channel.cc ('k') | chrome/common/ipc_sync_message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/ipc_sync_message.h
diff --git a/chrome/common/ipc_sync_message.h b/chrome/common/ipc_sync_message.h
index 116e6c7be88d0aff452aed2ef7c2c8a644ba258d..034de07ca696a22d18df65bfdf352175602c9118 100644
--- a/chrome/common/ipc_sync_message.h
+++ b/chrome/common/ipc_sync_message.h
@@ -12,6 +12,10 @@
#include "base/basictypes.h"
#include "chrome/common/ipc_message.h"
+namespace base {
+class WaitableEvent;
+}
+
namespace IPC {
class MessageReplyDeserializer;
@@ -26,15 +30,13 @@ class SyncMessage : public Message {
// for deleting the deserializer when they're done.
MessageReplyDeserializer* GetReplyDeserializer();
-// TODO(playmobil): reimplement on POSIX.
-#if defined(OS_WIN)
// If this message can cause the receiver to block while waiting for user
// input (i.e. by calling MessageBox), then the caller needs to pump window
// messages and dispatch asynchronous messages while waiting for the reply.
- // If this handle is passed in, then window messages will start being pumped
+ // If this event is passed in, then window messages will start being pumped
// when it's set. Note that this behavior will continue even if the event is
- // later reset. The handle must be valid until after the Send call returns.
- void set_pump_messages_event(HANDLE event) {
+ // later reset. The event must be valid until after the Send call returns.
+ void set_pump_messages_event(base::WaitableEvent* event) {
pump_messages_event_ = event;
if (event) {
header()->flags |= PUMPING_MSGS_BIT;
@@ -47,8 +49,9 @@ class SyncMessage : public Message {
// or set_pump_messages_event but not both.
void EnableMessagePumping();
- HANDLE pump_messages_event() const { return pump_messages_event_; }
-#endif // defined(OS_WIN)
+ base::WaitableEvent* pump_messages_event() const {
+ return pump_messages_event_;
+ }
// Returns true if the message is a reply to the given request id.
static bool IsMessageReplyTo(const Message& msg, int request_id);
@@ -73,9 +76,7 @@ class SyncMessage : public Message {
static bool WriteSyncHeader(Message* msg, const SyncHeader& header);
MessageReplyDeserializer* deserializer_;
-#if defined(OS_WIN)
- HANDLE pump_messages_event_;
-#endif
+ base::WaitableEvent* pump_messages_event_;
static uint32 next_id_; // for generation of unique ids
};
« no previous file with comments | « chrome/common/ipc_sync_channel.cc ('k') | chrome/common/ipc_sync_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698