Chromium Code Reviews| Index: services/shell/public/cpp/service.h |
| diff --git a/services/shell/public/cpp/service.h b/services/shell/public/cpp/service.h |
| index d79c2ca83e3d710d4bde7ed2c8d40f631ead7ecd..64798d5411d274e604abf03c06b339afe9d9d013 100644 |
| --- a/services/shell/public/cpp/service.h |
| +++ b/services/shell/public/cpp/service.h |
| @@ -14,7 +14,8 @@ |
| namespace shell { |
| -class Connector; |
| + class Connector; |
|
Ken Rockot(use gerrit already)
2016/07/26 22:38:25
nit indent
|
| +class ServiceContext; |
| // The primary contract between a Service and the Service Manager, receiving |
| // lifecycle notifications and connection requests. |
| @@ -26,12 +27,8 @@ class Service { |
| // Called once a bidirectional connection with the Service Manager has been |
| // established. |
| // |identity| is the identity of the service instance. |
| - // |id| is a unique identifier the Service Manager uses to identify this |
| - // specific instance of the service. |
| // Called exactly once before any other method. |
| - virtual void OnStart(Connector* connector, |
| - const Identity& identity, |
| - uint32_t id); |
| + virtual void OnStart(const Identity& identity); |
| // Called when a connection to this service is brokered by the Service |
| // Manager. Override to expose interfaces to the remote service. Return true |
| @@ -55,7 +52,13 @@ class Service { |
| virtual InterfaceProvider* GetInterfaceProviderForConnection(); |
| virtual InterfaceRegistry* GetInterfaceRegistryForConnection(); |
| + Connector* connector(); |
| + ServiceContext* context(); |
| + void set_context(std::unique_ptr<ServiceContext> context); |
| + |
| private: |
| + std::unique_ptr<ServiceContext> context_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(Service); |
| }; |