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

Unified Diff: ipc/ipc_channel_mojo.h

Issue 2163633003: Support early associated interface binding on ChannelMojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicit-channel-ipc-task-runner
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.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 940dcf0bbb085a3f32f39a9931366c82a925c6e7..cfadb50adc27bb1ac920cd8f3b47319b1cc2d888 100644
--- a/ipc/ipc_channel_mojo.h
+++ b/ipc/ipc_channel_mojo.h
@@ -42,7 +42,7 @@ namespace IPC {
class IPC_EXPORT ChannelMojo
: public Channel,
public Channel::AssociatedInterfaceSupport,
- public MojoBootstrap::Delegate,
+ public NON_EXPORTED_BASE(MojoBootstrap::Delegate),
public NON_EXPORTED_BASE(internal::MessagePipeReader::Delegate) {
public:
// Creates a ChannelMojo.
@@ -90,17 +90,16 @@ class IPC_EXPORT ChannelMojo
mojo::Array<mojom::SerializedHandlePtr>* handles);
// MojoBootstrapDelegate implementation
- void OnPipesAvailable(mojom::ChannelAssociatedPtrInfo send_channel,
- mojom::ChannelAssociatedRequest receive_channel,
- int32_t peer_pid) override;
- void OnBootstrapError() override;
- void OnAssociatedInterfaceRequest(
- const std::string& name,
- mojo::ScopedInterfaceEndpointHandle handle) override;
+ void OnPipesAvailable(mojom::ChannelAssociatedPtr sender,
+ mojom::ChannelAssociatedRequest receiver) override;
// MessagePipeReader::Delegate
+ void OnPeerPidReceived() override;
void OnMessageReceived(const Message& message) override;
void OnPipeError() override;
+ void OnAssociatedInterfaceRequest(
+ const std::string& name,
+ mojo::ScopedInterfaceEndpointHandle handle) override;
private:
ChannelMojo(
@@ -109,10 +108,6 @@ class IPC_EXPORT ChannelMojo
Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner);
- void InitMessageReader(mojom::ChannelAssociatedPtrInfo sender,
- mojom::ChannelAssociatedRequest receiver,
- base::ProcessId peer_pid);
-
// Channel::AssociatedInterfaceSupport:
mojo::AssociatedGroup* GetAssociatedGroup() override;
void AddGenericAssociatedInterface(
@@ -121,13 +116,6 @@ class IPC_EXPORT ChannelMojo
void GetGenericRemoteAssociatedInterface(
const std::string& name,
mojo::ScopedInterfaceEndpointHandle handle) override;
- void SetProxyTaskRunner(
- scoped_refptr<base::SingleThreadTaskRunner> task_runner) override;
-
- // ChannelMojo needs to kill its MessagePipeReader in delayed manner
- // because the channel wants to kill these readers during the
- // notifications invoked by them.
- typedef internal::MessagePipeReader::DelayedDeleter ReaderDeleter;
// A TaskRunner which runs tasks on the ChannelMojo's owning thread.
scoped_refptr<base::TaskRunner> task_runner_;
@@ -136,15 +124,12 @@ class IPC_EXPORT ChannelMojo
std::unique_ptr<MojoBootstrap> bootstrap_;
Listener* listener_;
+ std::unique_ptr<internal::MessagePipeReader> message_reader_;
+
+ base::Lock associated_interface_lock_;
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_;
- std::vector<std::unique_ptr<Message>> pending_messages_;
- bool waiting_connect_;
-
base::WeakPtrFactory<ChannelMojo> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ChannelMojo);
« 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