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

Unified Diff: mash/browser/browser.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/browser/browser.h ('k') | mash/catalog_viewer/catalog_viewer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/browser/browser.cc
diff --git a/mash/browser/browser.cc b/mash/browser/browser.cc
index 5e1e3145019114c57492c9766e6643cd86ec78ca..816afb0d6a7065dae1d32397064ce38efbe06050 100644
--- a/mash/browser/browser.cc
+++ b/mash/browser/browser.cc
@@ -21,7 +21,9 @@
#include "services/navigation/public/interfaces/view.mojom.h"
#include "services/service_manager/public/c/main.h"
#include "services/service_manager/public/cpp/connector.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 "services/ui/public/cpp/window.h"
@@ -863,17 +865,18 @@ void Browser::RemoveWindow(views::Widget* window) {
std::unique_ptr<navigation::View> Browser::CreateView() {
navigation::mojom::ViewFactoryPtr factory;
- connector()->ConnectToInterface("exe:navigation", &factory);
+ context_->connector()->ConnectToInterface("exe:navigation", &factory);
return base::MakeUnique<navigation::View>(std::move(factory));
}
-void Browser::OnStart(const service_manager::ServiceInfo& info) {
- tracing_.Initialize(connector(), info.identity.name());
+void Browser::OnStart(service_manager::ServiceContext* context) {
+ context_ = context;
+ tracing_.Initialize(context->connector(), context->identity().name());
- aura_init_ = base::MakeUnique<views::AuraInit>(connector(), info.identity,
- "views_mus_resources.pak");
- window_manager_connection_ =
- views::WindowManagerConnection::Create(connector(), info.identity);
+ 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 Browser::OnConnect(const service_manager::ServiceInfo& remote_info,
« no previous file with comments | « mash/browser/browser.h ('k') | mash/catalog_viewer/catalog_viewer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698