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

Unified Diff: ipc/ipc_channel_mojo.h

Issue 2137353002: Adds associated interface support to IPC::Channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@channel-bindings-1
Patch Set: . Created 4 years, 5 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_common.cc ('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 774a82a2627ddaadb86bfee0413f954fa358006f..c267649dd849530f4f648982f3e4f5db90dd3019 100644
--- a/ipc/ipc_channel_mojo.h
+++ b/ipc/ipc_channel_mojo.h
@@ -7,7 +7,9 @@
#include <stdint.h>
+#include <map>
#include <memory>
+#include <string>
#include <vector>
#include "base/macros.h"
@@ -37,6 +39,7 @@ namespace IPC {
//
class IPC_EXPORT ChannelMojo
: public Channel,
+ public Channel::AssociatedInterfaceSupport,
public MojoBootstrap::Delegate,
public NON_EXPORTED_BASE(internal::MessagePipeReader::Delegate) {
public:
@@ -62,6 +65,7 @@ class IPC_EXPORT ChannelMojo
bool IsSendThreadSafe() const override;
base::ProcessId GetPeerPID() const override;
base::ProcessId GetSelfPID() const override;
+ Channel::AssociatedInterfaceSupport* GetAssociatedInterfaceSupport() override;
#if defined(OS_POSIX) && !defined(OS_NACL_SFI)
int GetClientFileDescriptor() const override;
@@ -82,6 +86,9 @@ class IPC_EXPORT ChannelMojo
mojom::ChannelAssociatedRequest receive_channel,
int32_t peer_pid) override;
void OnBootstrapError() override;
+ void OnAssociatedInterfaceRequest(
+ const std::string& name,
+ mojo::ScopedInterfaceEndpointHandle handle) override;
// MessagePipeReader::Delegate
void OnMessageReceived(const Message& message) override;
@@ -96,6 +103,15 @@ class IPC_EXPORT ChannelMojo
mojom::ChannelAssociatedRequest receiver,
base::ProcessId peer_pid);
+ // Channel::AssociatedInterfaceSupport:
+ mojo::AssociatedGroup* GetAssociatedGroup() override;
+ void AddGenericAssociatedInterface(
+ const std::string& name,
+ const GenericAssociatedInterfaceFactory& factory) override;
+ void GetGenericRemoteAssociatedInterface(
+ const std::string& name,
+ mojo::ScopedInterfaceEndpointHandle handle) override;
+
// ChannelMojo needs to kill its MessagePipeReader in delayed manner
// because the channel wants to kill these readers during the
// notifications invoked by them.
@@ -108,6 +124,9 @@ class IPC_EXPORT ChannelMojo
std::unique_ptr<MojoBootstrap> bootstrap_;
Listener* listener_;
+ std::map<std::string, GenericAssociatedInterfaceFactory>
+ associated_interfaces_;
+
// Guards access to the fields below.
mutable base::Lock lock_;
std::unique_ptr<internal::MessagePipeReader, ReaderDeleter> message_reader_;
« no previous file with comments | « ipc/ipc_channel_common.cc ('k') | ipc/ipc_channel_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698