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(); } |