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

Unified Diff: ipc/ipc_channel_mojo.h

Issue 2173303002: Revert of 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 cfadb50adc27bb1ac920cd8f3b47319b1cc2d888..940dcf0bbb085a3f32f39a9931366c82a925c6e7 100644
--- a/ipc/ipc_channel_mojo.h
+++ b/ipc/ipc_channel_mojo.h
@@ -42,7 +42,7 @@
class IPC_EXPORT ChannelMojo
: public Channel,
public Channel::AssociatedInterfaceSupport,
- public NON_EXPORTED_BASE(MojoBootstrap::Delegate),
+ public MojoBootstrap::Delegate,
public NON_EXPORTED_BASE(internal::MessagePipeReader::Delegate) {
public:
// Creates a ChannelMojo.
@@ -90,16 +90,17 @@
mojo::Array<mojom::SerializedHandlePtr>* handles);
// MojoBootstrapDelegate implementation
- void OnPipesAvailable(mojom::ChannelAssociatedPtr sender,
- mojom::ChannelAssociatedRequest receiver) override;
-
- // MessagePipeReader::Delegate
- void OnPeerPidReceived() override;
- void OnMessageReceived(const Message& message) override;
- void OnPipeError() override;
+ 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;
+
+ // MessagePipeReader::Delegate
+ void OnMessageReceived(const Message& message) override;
+ void OnPipeError() override;
private:
ChannelMojo(
@@ -107,6 +108,10 @@
Mode mode,
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;
@@ -116,6 +121,13 @@
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_;
@@ -124,11 +136,14 @@
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_;
« 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