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

Unified Diff: ipc/ipc_sync_channel.h

Issue 1601005: Allow synchronous messages to be sent from threads other than the main thread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 | « ipc/ipc.gypi ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_sync_channel.h
===================================================================
--- ipc/ipc_sync_channel.h (revision 43588)
+++ ipc/ipc_sync_channel.h (working copy)
@@ -13,6 +13,7 @@
#include "base/ref_counted.h"
#include "base/waitable_event_watcher.h"
#include "ipc/ipc_channel_proxy.h"
+#include "ipc/ipc_sync_message.h"
namespace base {
class WaitableEvent;
@@ -23,8 +24,8 @@
class SyncMessage;
class MessageReplyDeserializer;
-// This is similar to IPC::ChannelProxy, with the added feature of supporting
-// sending synchronous messages.
+// This is similar to ChannelProxy, with the added feature of supporting sending
+// synchronous messages.
// Note that care must be taken that the lifetime of the ipc_thread argument
// is more than this object. If the message loop goes away while this object
// is running and it's used to send a message, then it will use the invalid
@@ -63,7 +64,7 @@
// Adds information about an outgoing sync message to the context so that
// we know how to deserialize the reply.
- void Push(IPC::SyncMessage* sync_msg);
+ void Push(SyncMessage* sync_msg);
// Cleanly remove the top deserializer (and throw it away). Returns the
// result of the Send call for that message.
@@ -96,7 +97,7 @@
private:
~SyncContext();
- // IPC::ChannelProxy methods that we override.
+ // ChannelProxy methods that we override.
// Called on the listener thread.
virtual void Clear();
@@ -113,18 +114,6 @@
// WaitableEventWatcher::Delegate implementation.
virtual void OnWaitableEventSignaled(base::WaitableEvent* arg);
- // When sending a synchronous message, this structure contains an object
- // that knows how to deserialize the response.
- struct PendingSyncMsg {
- PendingSyncMsg(int id, IPC::MessageReplyDeserializer* d,
- base::WaitableEvent* e) :
- id(id), deserializer(d), done_event(e), send_result(false) { }
- int id;
- IPC::MessageReplyDeserializer* deserializer;
- base::WaitableEvent* done_event;
- bool send_result;
- };
-
typedef std::deque<PendingSyncMsg> PendingSyncMessageQueue;
PendingSyncMessageQueue deserializers_;
Lock deserializers_lock_;
« no previous file with comments | « ipc/ipc.gypi ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698