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

Unified Diff: mash/session/session.cc

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 | « mash/session/session.h ('k') | mash/task_viewer/task_viewer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/session/session.cc
diff --git a/mash/session/session.cc b/mash/session/session.cc
index 29dac54099e58b3a000aa43176076d508cc41292..a9589c40fe67616a7aeeb44201d2d3c12dc73fb9 100644
--- a/mash/session/session.cc
+++ b/mash/session/session.cc
@@ -24,13 +24,10 @@ void LogAndCallServiceRestartCallback(const std::string& url,
namespace mash {
namespace session {
-Session::Session() : connector_(nullptr), screen_locked_(false) {}
+Session::Session() : screen_locked_(false) {}
Session::~Session() {}
-void Session::OnStart(shell::Connector* connector,
- const shell::Identity& identity,
- uint32_t id) {
- connector_ = connector;
+void Session::OnStart(const shell::Identity& identity) {
StartAppDriver();
StartWindowManager();
StartSystemUI();
@@ -46,7 +43,7 @@ void Session::Logout() {
// TODO(beng): Notify connected listeners that login is happening, potentially
// give them the option to stop it.
mash::login::mojom::LoginPtr login;
- connector_->ConnectToInterface("mojo:login", &login);
+ connector()->ConnectToInterface("mojo:login", &login);
login->ShowLoginUI();
// This kills the user environment.
base::MessageLoop::current()->QuitWhenIdle();
@@ -54,7 +51,7 @@ void Session::Logout() {
void Session::SwitchUser() {
mash::login::mojom::LoginPtr login;
- connector_->ConnectToInterface("mojo:login", &login);
+ connector()->ConnectToInterface("mojo:login", &login);
login->SwitchUser();
}
@@ -134,7 +131,8 @@ void Session::StartRestartableService(
const base::Closure& restart_callback) {
// TODO(beng): This would be the place to insert logic that counted restarts
// to avoid infinite crash-restart loops.
- std::unique_ptr<shell::Connection> connection = connector_->Connect(url);
+ std::unique_ptr<shell::Connection> connection =
+ connector()->Connect(url);
// Note: |connection| may be null if we've lost our connection to the shell.
if (connection) {
connection->SetConnectionLostClosure(
« no previous file with comments | « mash/session/session.h ('k') | mash/task_viewer/task_viewer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698