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

Unified Diff: ipc/ipc_channel_mojo.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/ipc_channel.h ('k') | ipc/ipc_channel_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_mojo.h
diff --git a/ipc/ipc_channel_mojo.h b/ipc/ipc_channel_mojo.h
index 215b198d60c25ddc85996837e8b4c356ea74d863..d2d6880f32554d41d58ce58284258e6914a1a9e7 100644
--- a/ipc/ipc_channel_mojo.h
+++ b/ipc/ipc_channel_mojo.h
@@ -21,11 +21,13 @@
#include "base/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.h"
#include "ipc/ipc_channel_factory.h"
#include "ipc/ipc_export.h"
#include "ipc/ipc_message_pipe_reader.h"
#include "ipc/ipc_mojo_bootstrap.h"
+#include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h"
#include "mojo/public/cpp/system/core.h"
namespace IPC {
@@ -42,7 +44,6 @@ namespace IPC {
class IPC_EXPORT ChannelMojo
: public Channel,
public Channel::AssociatedInterfaceSupport,
- public NON_EXPORTED_BASE(MojoBootstrap::Delegate),
public NON_EXPORTED_BASE(internal::MessagePipeReader::Delegate) {
public:
// Creates a ChannelMojo.
@@ -84,10 +85,6 @@ class IPC_EXPORT ChannelMojo
Message* message,
base::Optional<std::vector<mojom::SerializedHandlePtr>>* handles);
- // MojoBootstrapDelegate implementation
- void OnPipesAvailable(mojom::ChannelAssociatedPtr sender,
- mojom::ChannelAssociatedRequest receiver) override;
-
// MessagePipeReader::Delegate
void OnPeerPidReceived(int32_t peer_pid) override;
void OnMessageReceived(const Message& message) override;
@@ -103,8 +100,15 @@ class IPC_EXPORT ChannelMojo
Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner);
+ void ForwardMessageFromThreadSafePtr(mojo::Message message);
+ void ForwardMessageWithResponderFromThreadSafePtr(
+ mojo::Message message,
+ std::unique_ptr<mojo::MessageReceiver> responder);
+
// Channel::AssociatedInterfaceSupport:
mojo::AssociatedGroup* GetAssociatedGroup() override;
+ std::unique_ptr<mojo::ThreadSafeForwarder<mojom::Channel>>
+ CreateThreadSafeChannel() override;
void AddGenericAssociatedInterface(
const std::string& name,
const GenericAssociatedInterfaceFactory& factory) override;
@@ -113,7 +117,7 @@ class IPC_EXPORT ChannelMojo
mojo::ScopedInterfaceEndpointHandle handle) override;
// A TaskRunner which runs tasks on the ChannelMojo's owning thread.
- scoped_refptr<base::TaskRunner> task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
const mojo::MessagePipeHandle pipe_;
std::unique_ptr<MojoBootstrap> bootstrap_;
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698