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

Unified Diff: ipc/ipc_sync_channel.h

Issue 2067233002: Revert of Use Mojo pipes to signal sync IPC events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 07d2f6947a9acb805418db2d8c118e624142e7fe..bfa9b93e2d01003628020ff29e1f292758cc0a58 100644
--- a/ipc/ipc_sync_channel.h
+++ b/ipc/ipc_sync_channel.h
@@ -18,22 +18,15 @@
#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.
@@ -149,13 +142,13 @@
// result of the Send call for that message.
bool Pop();
- // Returns a Mojo Event that signals when a sync send is complete or timed
- // out or the process shut down.
- MojoEvent* 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();
+ // Returns an event that's set when the send is complete, timed out or the
+ // process shut down.
+ base::WaitableEvent* 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();
void DispatchMessages();
@@ -177,6 +170,8 @@
int restrict_dispatch_group() const {
return restrict_dispatch_group_;
}
+
+ base::WaitableEventWatcher::EventCallback MakeWaitableEventCallback();
private:
~SyncContext() override;
@@ -194,7 +189,7 @@
// Cancels all pending Send calls.
void CancelPendingSends();
- void OnShutdownEventSignaled(base::WaitableEvent* event);
+ void OnWaitableEventSignaled(base::WaitableEvent* event);
typedef std::deque<PendingSyncMsg> PendingSyncMessageQueue;
PendingSyncMessageQueue deserializers_;
@@ -214,7 +209,7 @@
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
base::WaitableEvent* shutdown_event);
- void OnDispatchHandleReady(MojoResult result);
+ void OnWaitableEventSignaled(base::WaitableEvent* arg);
SyncContext* sync_context() {
return reinterpret_cast<SyncContext*>(context());
@@ -222,7 +217,8 @@
// 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, bool pump_messages);
+ static void WaitForReply(
+ SyncContext* context, base::WaitableEvent* pump_messages_event);
// Runs a nested message loop until a reply arrives, times out, or the process
// shuts down.
@@ -237,7 +233,8 @@
bool SendOnIPCThread(std::unique_ptr<Message> message) override;
// Used to signal events between the IPC and listener threads.
- mojo::Watcher 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_nacl.gyp ('k') | ipc/ipc_sync_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698