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

Unified Diff: ui/views/mus/aura_init.cc

Issue 2858103002: Have mash_browser_tests recreate BackgroundServiceManager per test (Closed)
Patch Set: Revert AuraInit Quitting 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
« services/ui/service.cc ('K') | « ui/views/mus/aura_init.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/aura_init.cc
diff --git a/ui/views/mus/aura_init.cc b/ui/views/mus/aura_init.cc
index 7f73dc190f410c7ca759ac28be41f692f7b3c29e..4f86855424f408c68578bc9d5bac886707154473 100644
--- a/ui/views/mus/aura_init.cc
+++ b/ui/views/mus/aura_init.cc
@@ -70,7 +70,9 @@ AuraInit::AuraInit(service_manager::Connector* connector,
base::WrapUnique(new MusClient(connector, identity, io_task_runner));
}
ui::MaterialDesignController::Initialize();
- InitializeResources(connector);
+ // If resources are unavailable do not complete start-up.
+ if (!InitializeResources(connector))
+ return;
// Initialize the skia font code to go ask fontconfig underneath.
#if defined(OS_LINUX)
@@ -97,11 +99,11 @@ AuraInit::~AuraInit() {
#endif
}
-void AuraInit::InitializeResources(service_manager::Connector* connector) {
+bool AuraInit::InitializeResources(service_manager::Connector* connector) {
// Resources may have already been initialized (e.g. when 'chrome --mash' is
// used to launch the current app).
if (ui::ResourceBundle::HasSharedInstance())
- return;
+ return true;
std::set<std::string> resource_paths({resource_file_});
if (!resource_file_200_.empty())
@@ -110,7 +112,11 @@ void AuraInit::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) << "AuraInit failed to open resource files.\n";
sky 2017/05/18 20:30:28 no \n here either.
jonross 2017/05/18 20:40:24 reverted.
+ return false;
+ }
+
ui::RegisterPathProvider();
base::File pak_file = loader.TakeFile(resource_file_);
base::File pak_file_2 = pak_file.Duplicate();
@@ -121,6 +127,7 @@ void AuraInit::InitializeResources(service_manager::Connector* connector) {
if (!resource_file_200_.empty())
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
loader.TakeFile(resource_file_200_), ui::SCALE_FACTOR_200P);
+ return true;
}
} // namespace views
« services/ui/service.cc ('K') | « ui/views/mus/aura_init.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698