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

Unified Diff: ipc/ipc_sync_channel.h

Issue 2033243003: Use Mojo pipes to signal sync IPC events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gyp Created 4 years, 6 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_nacl.gyp ('k') | ipc/ipc_sync_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_sync_channel.h
diff --git a/ipc/ipc_sync_channel.h b/ipc/ipc_sync_channel.h
index bfa9b93e2d01003628020ff29e1f292758cc0a58..07d2f6947a9acb805418db2d8c118e624142e7fe 100644
--- a/ipc/ipc_sync_channel.h
+++ b/ipc/ipc_sync_channel.h
@@ -18,15 +18,22 @@
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_sync_message.h"
#include "ipc/ipc_sync_message_filter.h"
+#include "mojo/public/c/system/types.h"
+#include "mojo/public/cpp/system/watcher.h"
namespace base {
class WaitableEvent;
};
+namespace mojo {
+class Watcher;
+}
+
namespace IPC {
-class SyncMessage;
class ChannelFactory;
+class MojoEvent;
+class SyncMessage;
// This is similar to ChannelProxy, with the added feature of supporting sending
// synchronous messages.
@@ -142,13 +149,13 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
// result of the Send call for that message.
bool Pop();
- // Returns an event that's set when the send is complete, timed out or the
- // process shut down.
- base::WaitableEvent* GetSendDoneEvent();
+ // Returns a Mojo Event that signals when a sync send is complete or timed
+ // out or the process shut down.
+ MojoEvent* GetSendDoneEvent();
- // Returns an event that's set when an incoming message that's not the reply
- // needs to get dispatched (by calling SyncContext::DispatchMessages).
- base::WaitableEvent* GetDispatchEvent();
+ // Returns a Mojo Event that signals when an incoming message that's not the
+ // pending reply needs to get dispatched (by calling DispatchMessages.)
+ MojoEvent* GetDispatchEvent();
void DispatchMessages();
@@ -171,8 +178,6 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
return restrict_dispatch_group_;
}
- base::WaitableEventWatcher::EventCallback MakeWaitableEventCallback();
-
private:
~SyncContext() override;
// ChannelProxy methods that we override.
@@ -189,7 +194,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
// Cancels all pending Send calls.
void CancelPendingSends();
- void OnWaitableEventSignaled(base::WaitableEvent* event);
+ void OnShutdownEventSignaled(base::WaitableEvent* event);
typedef std::deque<PendingSyncMsg> PendingSyncMessageQueue;
PendingSyncMessageQueue deserializers_;
@@ -209,7 +214,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
base::WaitableEvent* shutdown_event);
- void OnWaitableEventSignaled(base::WaitableEvent* arg);
+ void OnDispatchHandleReady(MojoResult result);
SyncContext* sync_context() {
return reinterpret_cast<SyncContext*>(context());
@@ -217,8 +222,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
// Both these functions wait for a reply, timeout or process shutdown. The
// latter one also runs a nested message loop in the meantime.
- static void WaitForReply(
- SyncContext* context, base::WaitableEvent* pump_messages_event);
+ static void WaitForReply(SyncContext* context, bool pump_messages);
// Runs a nested message loop until a reply arrives, times out, or the process
// shuts down.
@@ -233,8 +237,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
bool SendOnIPCThread(std::unique_ptr<Message> message) override;
// Used to signal events between the IPC and listener threads.
- base::WaitableEventWatcher dispatch_watcher_;
- base::WaitableEventWatcher::EventCallback dispatch_watcher_callback_;
+ mojo::Watcher dispatch_watcher_;
// Tracks SyncMessageFilters created before complete channel initialization.
std::vector<scoped_refptr<SyncMessageFilter>> pre_init_sync_message_filters_;
« no previous file with comments | « ipc/ipc_nacl.gyp ('k') | ipc/ipc_sync_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698