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

Unified Diff: mash/example/views_examples/views_examples.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 | « mash/catalog_viewer/catalog_viewer.cc ('k') | mash/example/window_type_launcher/window_type_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/example/views_examples/views_examples.cc
diff --git a/mash/example/views_examples/views_examples.cc b/mash/example/views_examples/views_examples.cc
index 0d108da1a265805b7648d17cfc0def5737e87d31..7c3380eccaecc19dabe3d9c9119bba3e9c2f534e 100644
--- a/mash/example/views_examples/views_examples.cc
+++ b/mash/example/views_examples/views_examples.cc
@@ -11,7 +11,10 @@
#include "services/service_manager/public/c/main.h"
#include "services/service_manager/public/cpp/connection.h"
#include "services/service_manager/public/cpp/connector.h"
+#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/tracing/public/cpp/provider.h"
#include "ui/views/examples/example_base.h"
@@ -34,12 +37,12 @@ class ViewsExamples
private:
// service_manager::Service:
- void OnStart(const service_manager::ServiceInfo& info) override {
- tracing_.Initialize(connector(), info.identity.name());
- aura_init_ = base::MakeUnique<views::AuraInit>(connector(), info.identity,
- "views_mus_resources.pak");
- window_manager_connection_ =
- views::WindowManagerConnection::Create(connector(), info.identity);
+ void OnStart(service_manager::ServiceContext* context) override {
+ tracing_.Initialize(context->connector(), context->identity().name());
+ aura_init_ = base::MakeUnique<views::AuraInit>(
+ context->connector(), context->identity(), "views_mus_resources.pak");
+ window_manager_connection_ = views::WindowManagerConnection::Create(
+ context->connector(), context->identity());
}
bool OnConnect(const service_manager::ServiceInfo& remote_info,
service_manager::InterfaceRegistry* registry) override {
« no previous file with comments | « mash/catalog_viewer/catalog_viewer.cc ('k') | mash/example/window_type_launcher/window_type_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698