| Index: content/public/common/service_manager_connection.h
|
| diff --git a/content/public/common/mojo_shell_connection.h b/content/public/common/service_manager_connection.h
|
| similarity index 77%
|
| rename from content/public/common/mojo_shell_connection.h
|
| rename to content/public/common/service_manager_connection.h
|
| index ba9ff412e22ed5da56151ea8391a7629ce4997c9..f73d371afb89189e823eeba430f58eba23e4b77b 100644
|
| --- a/content/public/common/mojo_shell_connection.h
|
| +++ b/content/public/common/service_manager_connection.h
|
| @@ -2,15 +2,15 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CONTENT_PUBLIC_COMMON_MOJO_SHELL_CONNECTION_H_
|
| -#define CONTENT_PUBLIC_COMMON_MOJO_SHELL_CONNECTION_H_
|
| +#ifndef CONTENT_PUBLIC_COMMON_SERVICE_MANAGER_CONNECTION_H_
|
| +#define CONTENT_PUBLIC_COMMON_SERVICE_MANAGER_CONNECTION_H_
|
|
|
| #include <memory>
|
|
|
| #include "base/callback_forward.h"
|
| #include "base/sequenced_task_runner.h"
|
| #include "content/common/content_export.h"
|
| -#include "content/public/common/mojo_application_info.h"
|
| +#include "content/public/common/service_info.h"
|
| #include "services/shell/public/cpp/identity.h"
|
| #include "services/shell/public/interfaces/service.mojom.h"
|
|
|
| @@ -33,36 +33,38 @@ class ConnectionFilter;
|
| // Alternatively clients can define named services that will be constructed when
|
| // requests for those service names are received.
|
| // Clients must call any of the registration methods when receiving
|
| -// ContentBrowserClient::RegisterInProcessMojoApplications().
|
| -class CONTENT_EXPORT MojoShellConnection {
|
| +// ContentBrowserClient::RegisterInProcessServices().
|
| +class CONTENT_EXPORT ServiceManagerConnection {
|
| public:
|
| using ServiceRequestHandler =
|
| base::Callback<void(shell::mojom::ServiceRequest)>;
|
| - using Factory = base::Callback<std::unique_ptr<MojoShellConnection>(void)>;
|
| + using Factory =
|
| + base::Callback<std::unique_ptr<ServiceManagerConnection>(void)>;
|
|
|
| // Stores an instance of |connection| in TLS for the current process. Must be
|
| // called on the thread the connection was created on.
|
| - static void SetForProcess(std::unique_ptr<MojoShellConnection> connection);
|
| + static void SetForProcess(
|
| + std::unique_ptr<ServiceManagerConnection> connection);
|
|
|
| - // Returns the per-process instance, or nullptr if the Shell connection has
|
| - // not yet been bound. Must be called on the thread the connection was created
|
| - // on.
|
| - static MojoShellConnection* GetForProcess();
|
| + // Returns the per-process instance, or nullptr if the Service Manager
|
| + // connection has not yet been bound. Must be called on the thread the
|
| + // connection was created on.
|
| + static ServiceManagerConnection* GetForProcess();
|
|
|
| // Destroys the per-process instance. Must be called on the thread the
|
| // connection was created on.
|
| static void DestroyForProcess();
|
|
|
| - virtual ~MojoShellConnection();
|
| + virtual ~ServiceManagerConnection();
|
|
|
| - // Sets the factory used to create the MojoShellConnection. This must be
|
| - // called before the MojoShellConnection has been created.
|
| + // Sets the factory used to create the ServiceManagerConnection. This must be
|
| + // called before the ServiceManagerConnection has been created.
|
| static void SetFactoryForTest(Factory* factory);
|
|
|
| - // Creates a MojoShellConnection from |request|. The connection binds
|
| + // Creates a ServiceManagerConnection from |request|. The connection binds
|
| // its interfaces and accept new connections on |io_task_runner| only. Note
|
| // that no incoming connections are accepted until Start() is called.
|
| - static std::unique_ptr<MojoShellConnection> Create(
|
| + static std::unique_ptr<ServiceManagerConnection> Create(
|
| shell::mojom::ServiceRequest request,
|
| scoped_refptr<base::SequencedTaskRunner> io_task_runner);
|
|
|
| @@ -79,8 +81,9 @@ class CONTENT_EXPORT MojoShellConnection {
|
| // implementation. Use this to initiate connections as this object's Identity.
|
| virtual shell::Connector* GetConnector() = 0;
|
|
|
| - // Returns this connection's identity with the shell. Connections initiated
|
| - // via the shell::Connector returned by GetConnector() will use this.
|
| + // Returns this connection's identity with the Service Manager. Connections
|
| + // initiated via the shell::Connector returned by GetConnector() will use
|
| + // this.
|
| virtual const shell::Identity& GetIdentity() const = 0;
|
|
|
| // Sets a closure that is called when the connection is lost. Note that
|
| @@ -89,14 +92,14 @@ class CONTENT_EXPORT MojoShellConnection {
|
| virtual void SetConnectionLostClosure(const base::Closure& closure) = 0;
|
|
|
| // Provides an InterfaceRegistry to forward incoming interface requests to
|
| - // on the MojoShellConnection's own thread if they aren't bound by the
|
| + // on the ServiceManagerConnection's own thread if they aren't bound by the
|
| // connection's internal InterfaceRegistry on the IO thread.
|
| //
|
| // Also configures |interface_provider| to forward all of its outgoing
|
| // interface requests to the connection's internal remote interface provider.
|
| //
|
| // Note that neither |interface_registry| or |interface_provider| is owned
|
| - // and both MUST outlive the MojoShellConnection.
|
| + // and both MUST outlive the ServiceManagerConnection.
|
| //
|
| // TODO(rockot): Remove this. It's a temporary solution to avoid porting all
|
| // relevant code to ConnectionFilters at once.
|
| @@ -127,7 +130,7 @@ class CONTENT_EXPORT MojoShellConnection {
|
| // |info| provides details on how to construct new instances of the
|
| // service when an incoming connection is made to |name|.
|
| virtual void AddEmbeddedService(const std::string& name,
|
| - const MojoApplicationInfo& info) = 0;
|
| + const ServiceInfo& info) = 0;
|
|
|
| // Adds a generic ServiceRequestHandler for a given service name. This
|
| // will be used to satisfy any incoming calls to CreateService() which
|
| @@ -142,4 +145,4 @@ class CONTENT_EXPORT MojoShellConnection {
|
|
|
| } // namespace content
|
|
|
| -#endif // CONTENT_PUBLIC_COMMON_MOJO_SHELL_CONNECTION_H_
|
| +#endif // CONTENT_PUBLIC_COMMON_SERVICE_MANAGER_CONNECTION_H_
|
|
|