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

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: rebase 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
Index: ipc/ipc_channel_mojo.h
diff --git a/ipc/ipc_channel_mojo.h b/ipc/ipc_channel_mojo.h
index 774a82a2627ddaadb86bfee0413f954fa358006f..0f4c9c5a72325a7db8af57d0e7680388c8bb71ee 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"
@@ -58,6 +60,13 @@ class IPC_EXPORT ChannelMojo
// Channel implementation
bool Connect() override;
void Close() override;
+ mojo::AssociatedGroup* GetAssociatedGroup() override;
+ void AddGenericAssociatedInterface(
+ const std::string& name,
+ const GenericAssociatedInterfaceFactory& factory) override;
+ void GetGenericRemoteAssociatedInterface(
+ const std::string& name,
+ mojo::ScopedInterfaceEndpointHandle handle) override;
bool Send(Message* message) override;
bool IsSendThreadSafe() const override;
base::ProcessId GetPeerPID() const override;
@@ -82,6 +91,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;
@@ -108,6 +120,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_;
« ipc/ipc_channel.h ('K') | « 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