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

Unified Diff: ipc/ipc_sync_channel.h

Issue 2754143005: Use WaitableEvents to wake up sync IPC waiting (Closed)
Patch Set: . Created 3 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_mojo_bootstrap.cc ('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 7738b7fa7cd26646128e8c852da577cf13485b98..3f65ef38be0c6d045d06cad41ffff6f85f89a53c 100644
--- a/ipc/ipc_sync_channel.h
+++ b/ipc/ipc_sync_channel.h
@@ -22,6 +22,7 @@
#include "mojo/public/cpp/system/simple_watcher.h"
namespace base {
+class RunLoop;
class WaitableEvent;
};
@@ -32,7 +33,6 @@ class SyncHandleRegistry;
namespace IPC {
class ChannelFactory;
-class MojoEvent;
class SyncMessage;
// This is similar to ChannelProxy, with the added feature of supporting sending
@@ -151,11 +151,11 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
// Returns a Mojo Event that signals when a sync send is complete or timed
// out or the process shut down.
- MojoEvent* GetSendDoneEvent();
+ base::WaitableEvent* GetSendDoneEvent();
// 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();
+ base::WaitableEvent* GetDispatchEvent();
void DispatchMessages();
@@ -178,6 +178,9 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
return restrict_dispatch_group_;
}
+ void OnSendDoneEventSignaled(base::RunLoop* nested_loop,
+ base::WaitableEvent* event);
+
private:
~SyncContext() override;
// ChannelProxy methods that we override.
@@ -215,7 +218,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
base::WaitableEvent* shutdown_event);
- void OnDispatchHandleReady(MojoResult result);
+ void OnDispatchEventSignaled(base::WaitableEvent* event);
SyncContext* sync_context() {
return reinterpret_cast<SyncContext*>(context());
@@ -240,7 +243,8 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
scoped_refptr<mojo::SyncHandleRegistry> sync_handle_registry_;
// Used to signal events between the IPC and listener threads.
- mojo::SimpleWatcher dispatch_watcher_;
+ base::WaitableEventWatcher dispatch_watcher_;
+ base::WaitableEventWatcher::EventCallback dispatch_watcher_callback_;
// Tracks SyncMessageFilters created before complete channel initialization.
std::vector<scoped_refptr<SyncMessageFilter>> pre_init_sync_message_filters_;
« no previous file with comments | « ipc/ipc_mojo_bootstrap.cc ('k') | ipc/ipc_sync_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698