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

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

Issue 2179023004: Make Service own ServiceContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « services/shell/public/cpp/lib/service_test.cc ('k') | services/shell/public/cpp/service_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2ad2a57087507e96df5e54ef29df95259c770660 100644
--- a/services/shell/public/cpp/service.h
+++ b/services/shell/public/cpp/service.h
@@ -15,6 +15,7 @@
namespace shell {
class Connector;
+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);
};
« no previous file with comments | « services/shell/public/cpp/lib/service_test.cc ('k') | services/shell/public/cpp/service_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698