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

Unified Diff: services/shell/public/cpp/interface_provider.h

Issue 2111353002: Move content's shell connections to the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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: services/shell/public/cpp/interface_provider.h
diff --git a/services/shell/public/cpp/interface_provider.h b/services/shell/public/cpp/interface_provider.h
index fe6930e3f825d8a262ca4b4ed20cb13795958c95..67ae34fd294c7ec5bfbcd50db36ef9a1402795c1 100644
--- a/services/shell/public/cpp/interface_provider.h
+++ b/services/shell/public/cpp/interface_provider.h
@@ -18,6 +18,8 @@ namespace shell {
// Connection.
class InterfaceProvider {
public:
+ using ForwardCallback = base::Callback<void(const mojo::String&,
+ mojo::ScopedMessagePipeHandle)>;
class TestApi {
public:
explicit TestApi(InterfaceProvider* provider) : provider_(provider) {}
@@ -41,8 +43,16 @@ class InterfaceProvider {
InterfaceProvider();
~InterfaceProvider();
+ // Binds this InterfaceProvider to an actual mojom::InterfaceProvider pipe.
+ // It is an error to call this on a forwarding InterfaceProvider, i.e. this
+ // call is exclusive to Forward().
void Bind(mojom::InterfaceProviderPtr interface_provider);
+ // Sets this InterfaceProvider to forward all GetInterface() requests to
+ // |callback|. It is an error to call this on a bound InterfaceProvider, i.e.
+ // this call is exclusive to Bind().
+ void Forward(const ForwardCallback& callback);
+
// Returns a raw pointer to the remote InterfaceProvider.
mojom::InterfaceProvider* get() { return interface_provider_.get(); }

Powered by Google App Engine
This is Rietveld 408576698