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

Unified Diff: ipc/ipc_channel.h

Issue 2668153003: Mojo C++ Bindings: Eliminate unbound ThreadSafeInterfacePtr (Closed)
Patch Set: format and rebase... Created 3 years, 10 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/BUILD.gn ('k') | ipc/ipc_channel_mojo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « ipc/BUILD.gn ('k') | ipc/ipc_channel_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698