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

Unified Diff: ipc/ipc_channel_proxy.h

Issue 2522333002: Provide a Mojo equivalent of ThreadSafeSender. (Closed)
Patch Set: Addressed comments and synced 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
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.h
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index 5765630a2582349a9b470785eef7c4ae6842bd0f..4f458ed46672520216a5429c1d49441118486a76 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -230,6 +230,10 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
}
#endif
+ using RunOnIOThreadCallback = base::Callback<void(Channel*)>;
Tom Sepez 2016/11/28 18:49:11 nit: The name doesn't really describe that it take
Jay Civelli 2016/11/28 22:49:01 Renamed the callback as part of making the API mor
+ // Invokes |callback| on the IO (IPC) thread.
+ void RunOnIOThread(const RunOnIOThreadCallback& callback);
+
// Called to clear the pointer to the IPC task runner when it's going away.
void ClearIPCTaskRunner();
@@ -239,7 +243,6 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
// to the internal state.
explicit ChannelProxy(Context* context);
-
// Used internally to hold state that is referenced on the IPC thread.
class Context : public base::RefCountedThreadSafe<Context>,
public Listener {
@@ -304,6 +307,7 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
void OnSendMessage(std::unique_ptr<Message> message_ptr);
void OnAddFilter();
void OnRemoveFilter(MessageFilter* filter);
+ void RunWithChannel(const RunOnIOThreadCallback& callback);
// Methods called on the listener thread.
void AddFilter(MessageFilter* filter);
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698