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

Unified Diff: ui/base/resource/resource_bundle.cc

Issue 661503003: Revert of Eliminate silently letting errors pass on pak loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « content/test/test_content_client.cc ('k') | ui/base/resource/resource_bundle_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle.cc
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc
index fba91261a1abd3c0a7a4938df2bc513635671dba..37f6c773a43ebe489772aad7f3a4b9ed16fc1a54 100644
--- a/ui/base/resource/resource_bundle.cc
+++ b/ui/base/resource/resource_bundle.cc
@@ -250,7 +250,8 @@
base::File file,
const base::MemoryMappedFile::Region& region,
ScaleFactor scale_factor) {
- scoped_ptr<DataPack> data_pack(new DataPack(scale_factor));
+ scoped_ptr<DataPack> data_pack(
+ new DataPack(scale_factor));
if (data_pack->LoadFromFileRegion(file.Pass(), region)) {
AddDataPack(data_pack.release());
} else {
@@ -304,7 +305,8 @@
return std::string();
}
- scoped_ptr<DataPack> data_pack(new DataPack(SCALE_FACTOR_100P));
+ scoped_ptr<DataPack> data_pack(
+ new DataPack(SCALE_FACTOR_100P));
if (!data_pack->LoadFromPath(locale_file_path)) {
UMA_HISTOGRAM_ENUMERATION("ResourceBundle.LoadLocaleResourcesError",
logging::GetLastSystemErrorCode(), 16000);
@@ -663,15 +665,17 @@
if (delegate_)
pack_path = delegate_->GetPathForResourcePack(pack_path, scale_factor);
- // An empty path is a request from the delegate to cancel loading.
- if (pack_path.empty())
+ // Don't try to load empty values or values that are not absolute paths.
+ if (pack_path.empty() || !pack_path.IsAbsolute())
return;
- scoped_ptr<DataPack> data_pack(new DataPack(scale_factor));
+ scoped_ptr<DataPack> data_pack(
+ new DataPack(scale_factor));
if (data_pack->LoadFromPath(pack_path)) {
AddDataPack(data_pack.release());
} else if (!optional) {
- DLOG(FATAL) << "Failed to load " << pack_path.value();
+ LOG(ERROR) << "Failed to load " << pack_path.value()
+ << "\nSome features may not be available.";
}
}
« no previous file with comments | « content/test/test_content_client.cc ('k') | ui/base/resource/resource_bundle_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698