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

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 2522333002: Provide a Mojo equivalent of ThreadSafeSender. (Closed)
Patch Set: Clean-up Created 4 years, 1 month 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
Index: ipc/ipc_channel_proxy.cc
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 3365aef248747a657965bfd82c5751a8e69630b8..8928520a150e7662fe02abd433b19e957a169068 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -311,6 +311,11 @@ void ChannelProxy::Context::OnRemoveFilter(MessageFilter* filter) {
NOTREACHED() << "filter to be removed not found";
}
+void ChannelProxy::Context::RunWithChannel(
+ const RunOnIOThreadCallback& callback) {
+ callback.Run(channel_.get());
+}
+
// Called on the listener's thread
void ChannelProxy::Context::AddFilter(MessageFilter* filter) {
base::AutoLock auto_lock(pending_filters_lock_);
@@ -610,6 +615,12 @@ void ChannelProxy::GetGenericRemoteAssociatedInterface(
context_, name, base::Passed(&handle)));
}
+void ChannelProxy::RunOnIOThread(const RunOnIOThreadCallback& callback) {
+ DCHECK(did_init_);
+ context_->ipc_task_runner()->PostTask(
+ FROM_HERE, base::Bind(&Context::RunWithChannel, context_, callback));
+}
+
void ChannelProxy::ClearIPCTaskRunner() {
DCHECK(CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698