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

Unified Diff: chrome/app/mash/mash_runner.cc

Issue 2666383002: mash: Exit main process if ui service crashes (Closed)
Patch Set: Created 3 years, 11 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 | « chrome/app/mash/chrome_mash_manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/mash/mash_runner.cc
diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc
index cf7c891f34b9b58a4aca91ba9ec3c3232ebd9adb..e05f7ecf9dc7394c072c0346d9d9f0c514764425 100644
--- a/chrome/app/mash/mash_runner.cc
+++ b/chrome/app/mash/mash_runner.cc
@@ -50,6 +50,7 @@
#include "services/service_manager/runner/common/client_util.h"
#include "services/service_manager/runner/common/switches.h"
#include "services/service_manager/runner/init.h"
+#include "services/ui/public/interfaces/constants.mojom.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
@@ -155,13 +156,13 @@ void OnInstanceQuitInMain(base::RunLoop* run_loop,
DCHECK(exit_value);
DCHECK(run_loop);
- // TODO(jamescook): Also shut down if the window server dies.
- if (identity.name() != mash::common::GetWindowManagerServiceName())
- return;
-
- if (!run_loop->running())
James Cook 2017/02/01 18:19:54 This wasn't needed. RunLoop::Quit() is a no-op if
Ken Rockot(use gerrit already) 2017/02/01 21:13:55 Ah right, missed this. In fact, it's also not poss
James Cook 2017/02/01 21:26:51 Acknowledged.
+ if (identity.name() != mash::common::GetWindowManagerServiceName() &&
+ identity.name() != ui::mojom::kServiceName) {
return;
+ }
+ LOG(ERROR) << "Main process exiting because service " << identity.name()
+ << " quit unexpectedly.";
*exit_value = 1;
run_loop->Quit();
}
@@ -224,8 +225,9 @@ int MashRunner::RunServiceManagerInMain() {
background_service_manager.SetInstanceQuitCallback(
base::Bind(&OnInstanceQuitInMain, &run_loop, &exit_value));
- // Ping services that we know we want to launch on startup.
- // TODO(jamescook): Start the window server / ui service explicitly.
+ // Ping services that we know we want to launch on startup (UI service,
+ // window manager, quick launch app).
+ context_->connector()->Connect(ui::mojom::kServiceName);
context_->connector()->Connect(mash::common::GetWindowManagerServiceName());
context_->connector()->Connect(mash::quick_launch::mojom::kServiceName);
« no previous file with comments | « chrome/app/mash/chrome_mash_manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698