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

Unified Diff: services/service_manager/tests/shutdown/shutdown_client_app.cc

Issue 2476063002: Service Manager: Rework Service and ServiceContext lifetime (Closed)
Patch Set: . Created 4 years, 1 month 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/service_manager/tests/service_manager/target.cc ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/service_manager/tests/shutdown/shutdown_client_app.cc
diff --git a/services/service_manager/tests/shutdown/shutdown_client_app.cc b/services/service_manager/tests/shutdown/shutdown_client_app.cc
index 1b11a72efd275f5c5d74146310eb85fdc3ae7f40..bc222d6f8977030a9a7faed056bf3cf7221f70cc 100644
--- a/services/service_manager/tests/shutdown/shutdown_client_app.cc
+++ b/services/service_manager/tests/shutdown/shutdown_client_app.cc
@@ -10,6 +10,7 @@
#include "services/service_manager/public/cpp/interface_factory.h"
#include "services/service_manager/public/cpp/interface_registry.h"
#include "services/service_manager/public/cpp/service.h"
+#include "services/service_manager/public/cpp/service_context.h"
#include "services/service_manager/public/cpp/service_runner.h"
#include "services/service_manager/tests/shutdown/shutdown_unittest.mojom.h"
@@ -26,6 +27,10 @@ class ShutdownClientApp
private:
// service_manager::Service:
+ void OnStart(ServiceContext* context) override {
+ context_ = context;
+ }
+
bool OnConnect(const ServiceInfo& remote_info,
InterfaceRegistry* registry) override {
registry->AddInterface<mojom::ShutdownTestClientController>(this);
@@ -41,7 +46,8 @@ class ShutdownClientApp
// mojom::ShutdownTestClientController:
void ConnectAndWait(const ConnectAndWaitCallback& callback) override {
mojom::ShutdownTestServicePtr service;
- connector()->ConnectToInterface("service:shutdown_service", &service);
+ context_->connector()->ConnectToInterface(
+ "service:shutdown_service", &service);
mojo::Binding<mojom::ShutdownTestClient> client_binding(this);
@@ -59,6 +65,7 @@ class ShutdownClientApp
callback.Run();
}
+ ServiceContext* context_ = nullptr;
mojo::BindingSet<mojom::ShutdownTestClientController> bindings_;
DISALLOW_COPY_AND_ASSIGN(ShutdownClientApp);
« no previous file with comments | « services/service_manager/tests/service_manager/target.cc ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698