| Index: services/shell/public/cpp/shell_connection.h
|
| diff --git a/services/shell/public/cpp/shell_connection.h b/services/shell/public/cpp/shell_connection.h
|
| index 9c1b6800dea718a63ff234ae406b03ecc7d9592b..8348a210c6bf7c14d8d0e60b1afbfd97c63ed7e0 100644
|
| --- a/services/shell/public/cpp/shell_connection.h
|
| +++ b/services/shell/public/cpp/shell_connection.h
|
| @@ -11,14 +11,16 @@
|
|
|
| #include "base/callback.h"
|
| #include "base/macros.h"
|
| +#include "base/memory/scoped_vector.h"
|
| #include "mojo/public/cpp/bindings/binding.h"
|
| #include "mojo/public/cpp/system/core.h"
|
| -#include "services/shell/public/cpp/connector.h"
|
| #include "services/shell/public/cpp/service.h"
|
| #include "services/shell/public/interfaces/connector.mojom.h"
|
| #include "services/shell/public/interfaces/service.mojom.h"
|
|
|
| namespace shell {
|
| +
|
| +class Connector;
|
|
|
| // Encapsulates a connection to the Mojo Shell in two parts:
|
| // - a bound InterfacePtr to mojom::Shell, the primary mechanism
|
| @@ -43,19 +45,21 @@
|
| public:
|
| // Creates a new ShellConnection bound to |request|. This connection may be
|
| // used immediately to make outgoing connections via connector(). Does not
|
| - // take ownership of |service|, which must remain valid for the lifetime of
|
| - // ShellConnection. If either |connector| or |connector_request| is non-null
|
| - // both must be non-null. If both are null, the connection will create its own
|
| - // Connector and request to pass to the shell on initialization.
|
| - ShellConnection(shell::Service* service,
|
| - mojom::ServiceRequest request,
|
| - std::unique_ptr<Connector> connector = nullptr,
|
| - mojom::ConnectorRequest connector_request = nullptr);
|
| + // take ownership of |client|, which must remain valid for the lifetime of
|
| + // ShellConnection.
|
| + ShellConnection(shell::Service* client,
|
| + mojom::ServiceRequest request);
|
|
|
| ~ShellConnection() override;
|
|
|
| Connector* connector() { return connector_.get(); }
|
| const Identity& identity() { return identity_; }
|
| +
|
| + // TODO(rockot): Remove this. http://crbug.com/594852.
|
| + void set_initialize_handler(const base::Closure& callback);
|
| +
|
| + // TODO(rockot): Remove this once we get rid of app tests.
|
| + void SetAppTestConnectorForTesting(mojom::ConnectorPtr connector);
|
|
|
| // Specify a function to be called when the connection to the shell is lost.
|
| // Note that if connection has already been lost, then |closure| is called
|
| @@ -81,12 +85,12 @@
|
|
|
| // We track the lifetime of incoming connection registries as it more
|
| // convenient for the client.
|
| - std::vector<std::unique_ptr<Connection>> incoming_connections_;
|
| + ScopedVector<Connection> incoming_connections_;
|
|
|
| // A pending Connector request which will eventually be passed to the shell.
|
| mojom::ConnectorRequest pending_connector_request_;
|
|
|
| - shell::Service* service_;
|
| + shell::Service* client_;
|
| mojo::Binding<mojom::Service> binding_;
|
| std::unique_ptr<Connector> connector_;
|
| shell::Identity identity_;
|
|
|