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

Unified Diff: ipc/ipc_channel_proxy.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_mojo_unittest.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.h
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index ebbe3e3ae2a97186a849f2ae414a357bfecc3be5..03098c43e057ade692a769e6ec416ccb051826db 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -189,7 +189,8 @@
}
// Gets the AssociatedGroup used to create new associated endpoints on this
- // ChannelProxy.
+ // ChannelProxy. This must only be called after the listener's
+ // OnChannelConnected is called.
mojo::AssociatedGroup* GetAssociatedGroup();
// Requests an associated interface from the remote endpoint.
@@ -198,6 +199,7 @@
mojo::ScopedInterfaceEndpointHandle handle);
// Template helper to request associated interfaces from the remote endpoint.
+ // Must only be called after the listener's OnChannelConnected is called.
template <typename Interface>
void GetRemoteAssociatedInterface(
mojo::AssociatedInterfacePtr<Interface>* proxy) {
@@ -229,7 +231,7 @@
class Context;
// A subclass uses this constructor if it needs to add more information
// to the internal state.
- explicit ChannelProxy(Context* context);
+ ChannelProxy(Context* context);
// Used internally to hold state that is referenced on the IPC thread.
@@ -310,15 +312,6 @@
void SendFromThisThread(Message* message);
void ClearChannel();
- mojo::AssociatedGroup* associated_group() { return &associated_group_; }
-
- void AddGenericAssociatedInterface(
- const std::string& name,
- const GenericAssociatedInterfaceFactory& factory);
- void AddGenericAssociatedInterfaceForIOThread(
- const std::string& name,
- const GenericAssociatedInterfaceFactory& factory);
-
scoped_refptr<base::SingleThreadTaskRunner> listener_task_runner_;
Listener* listener_;
@@ -360,14 +353,15 @@
// brokerable attachment messages to/from the broker process.
bool attachment_broker_endpoint_;
- mojo::AssociatedGroup associated_group_;
-
- // Holds associated interface binders added by AddGenericAssociatedInterface
- // or AddGenericAssociatedInterfaceForIOThread until the underlying channel
- // has been initialized.
- base::Lock pending_interfaces_lock_;
- std::vector<std::pair<std::string, GenericAssociatedInterfaceFactory>>
- pending_interfaces_;
+ // Modified only on the listener's thread before Init() is called.
+ std::map<std::string, GenericAssociatedInterfaceFactory>
+ io_thread_interfaces_;
+ std::map<std::string, GenericAssociatedInterfaceFactory>
+ proxy_thread_interfaces_;
+
+ // Valid and constant any time after the ChannelProxy's Listener receives
+ // OnChannelConnected on its own thread.
+ std::unique_ptr<mojo::AssociatedGroup> channel_associated_group_;
};
Context* context() { return context_.get(); }
« no previous file with comments | « ipc/ipc_channel_mojo_unittest.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698