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

Unified Diff: ipc/mojo/ipc_channel_mojo.h

Issue 1130413002: Mojo IPC threading fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correct some outdated expectations during shutdown Created 5 years, 7 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 | « no previous file | ipc/mojo/ipc_channel_mojo.cc » ('j') | ipc/mojo/scoped_ipc_support.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_channel_mojo.h
diff --git a/ipc/mojo/ipc_channel_mojo.h b/ipc/mojo/ipc_channel_mojo.h
index 2f98b170fe03e0175cf6434f6208915cc1c22ee6..f1fbb25b724348a49614f1e1b4337115348d7891 100644
--- a/ipc/mojo/ipc_channel_mojo.h
+++ b/ipc/mojo/ipc_channel_mojo.h
@@ -51,6 +51,12 @@ class IPC_MOJO_EXPORT ChannelMojo
public MojoBootstrap::Delegate,
public NON_EXPORTED_BASE(internal::MessagePipeReader::Delegate) {
public:
+ using CreateMessagingPipeCallback =
+ base::Callback<void(mojo::ScopedMessagePipeHandle)>;
+ using CreateMessagingPipeOnIOThreadCallback =
+ base::Callback<void(mojo::ScopedMessagePipeHandle,
+ mojo::embedder::ChannelInfo*)>;
+
class Delegate {
public:
virtual ~Delegate() {}
@@ -125,8 +131,8 @@ class IPC_MOJO_EXPORT ChannelMojo
Mode mode,
Listener* listener);
- mojo::ScopedMessagePipeHandle CreateMessagingPipe(
- mojo::embedder::ScopedPlatformHandle handle);
+ void CreateMessagingPipe(mojo::embedder::ScopedPlatformHandle handle,
+ const CreateMessagingPipeCallback& callback);
void InitMessageReader(mojo::ScopedMessagePipeHandle pipe, int32_t peer_pid);
Listener* listener() const { return listener_; }
@@ -134,7 +140,12 @@ class IPC_MOJO_EXPORT ChannelMojo
private:
struct ChannelInfoDeleter {
+ explicit ChannelInfoDeleter(scoped_refptr<base::TaskRunner> io_runer);
jam 2015/05/11 15:53:25 nit: io_runner
Ken Rockot(use gerrit already) 2015/05/11 16:11:53 Done.
+ ~ChannelInfoDeleter();
+
void operator()(mojo::embedder::ChannelInfo* ptr) const;
+
+ scoped_refptr<base::TaskRunner> io_runner;
};
// ChannelMojo needs to kill its MessagePipeReader in delayed manner
@@ -144,6 +155,14 @@ class IPC_MOJO_EXPORT ChannelMojo
void InitOnIOThread(ChannelMojo::Delegate* delegate);
+ static void CreateMessagingPipeOnIOThread(
+ mojo::embedder::ScopedPlatformHandle handle,
+ scoped_refptr<base::TaskRunner> callback_runner,
+ const CreateMessagingPipeOnIOThreadCallback& callback);
+ void OnMessagingPipeCreated(const CreateMessagingPipeCallback& callback,
+ mojo::ScopedMessagePipeHandle handle,
+ mojo::embedder::ChannelInfo* channel_info);
+
scoped_ptr<MojoBootstrap> bootstrap_;
base::WeakPtr<Delegate> delegate_;
Mode mode_;
« no previous file with comments | « no previous file | ipc/mojo/ipc_channel_mojo.cc » ('j') | ipc/mojo/scoped_ipc_support.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698