Index: ipc/ipc_channel.h |
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h |
index 1c0a89d20d5e6ab95fa27e5ee9ad004e0ae11f2f..4a2014412af48ffbf4ea0d79e545ceccc0e98ed6 100644 |
--- a/ipc/ipc_channel.h |
+++ b/ipc/ipc_channel.h |
@@ -18,6 +18,7 @@ |
#include "base/single_thread_task_runner.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "build/build_config.h" |
+#include "ipc/ipc.mojom.h" |
#include "ipc/ipc_channel_handle.h" |
#include "ipc/ipc_message.h" |
#include "ipc/ipc_sender.h" |
@@ -25,6 +26,7 @@ |
#include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
#include "mojo/public/cpp/bindings/associated_interface_request.h" |
#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" |
+#include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h" |
#if defined(OS_POSIX) |
#include <sys/types.h> |
@@ -94,6 +96,11 @@ class IPC_EXPORT Channel : public Sender { |
// with this Channel. Must be safe to call from any thread. |
virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0; |
+ // Returns a ThreadSafeForwarded for this channel which can be used to |
+ // safely send mojom::Channel requests from arbitrary threads. |
+ virtual std::unique_ptr<mojo::ThreadSafeForwarder<mojom::Channel>> |
+ CreateThreadSafeChannel() = 0; |
+ |
// Adds an interface factory to this channel for interface |name|. Must be |
// safe to call from any thread. |
virtual void AddGenericAssociatedInterface( |