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

Unified Diff: services/ui/service.cc

Issue 2858103002: Have mash_browser_tests recreate BackgroundServiceManager per test (Closed)
Patch Set: disable failing nacl tests Created 3 years, 7 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 | « services/ui/service.h ('k') | testing/buildbot/chromium.chromiumos.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/service.cc
diff --git a/services/ui/service.cc b/services/ui/service.cc
index f44fe0467da9605072fafb53c7615df3dc25d3f1..4b65f678bdeba90ff14f6c9e6c995ac6fa61af72 100644
--- a/services/ui/service.cc
+++ b/services/ui/service.cc
@@ -100,9 +100,9 @@ Service::~Service() {
#endif
}
-void Service::InitializeResources(service_manager::Connector* connector) {
+bool Service::InitializeResources(service_manager::Connector* connector) {
if (ui::ResourceBundle::HasSharedInstance())
- return;
+ return true;
std::set<std::string> resource_paths;
resource_paths.insert(kResourceFileStrings);
@@ -112,7 +112,10 @@ void Service::InitializeResources(service_manager::Connector* connector) {
catalog::ResourceLoader loader;
filesystem::mojom::DirectoryPtr directory;
connector->BindInterface(catalog::mojom::kServiceName, &directory);
- CHECK(loader.OpenFiles(std::move(directory), resource_paths));
+ if (!loader.OpenFiles(std::move(directory), resource_paths)) {
+ LOG(ERROR) << "Service failed to open resource files.\n";
+ return false;
+ }
ui::RegisterPathProvider();
@@ -125,6 +128,7 @@ void Service::InitializeResources(service_manager::Connector* connector) {
ui::SCALE_FACTOR_100P);
rb.AddDataPackFromFile(loader.TakeFile(kResourceFile200),
ui::SCALE_FACTOR_200P);
+ return true;
}
Service::UserState* Service::GetUserState(
@@ -156,7 +160,9 @@ void Service::OnStart() {
if (test_config_)
ui::test::EnableTestConfigForPlatformWindows();
- InitializeResources(context()->connector());
+ // If resources are unavailable do not complete start-up.
+ if (!InitializeResources(context()->connector()))
jonross 2017/05/16 21:54:45 We talked offline about shutting down in response
sky 2017/05/17 16:58:59 I don't think we should change OnStart(), but coul
jonross 2017/05/18 19:23:28 Done.
+ return;
#if defined(USE_OZONE)
// The ozone platform can provide its own event source. So initialize the
« no previous file with comments | « services/ui/service.h ('k') | testing/buildbot/chromium.chromiumos.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698