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

Unified Diff: ui/base/resource/resource_bundle_ios.mm

Issue 537063002: Eliminate silently letting errors pass on pak loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one last time 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
Index: ui/base/resource/resource_bundle_ios.mm
diff --git a/ui/base/resource/resource_bundle_ios.mm b/ui/base/resource/resource_bundle_ios.mm
index 80cc74a8f6f6cfb44fa4590dbd249225b065d79c..b7a3049bda015b24573e09b88319f9093377a2a2 100644
--- a/ui/base/resource/resource_bundle_ios.mm
+++ b/ui/base/resource/resource_bundle_ios.mm
@@ -34,9 +34,16 @@ base::FilePath GetResourcesPakFilePath(NSString* name, NSString* mac_locale) {
resource_path = [base::mac::FrameworkBundle() pathForResource:name
ofType:@"pak"];
}
+
if (!resource_path) {
- // Return just the name of the pak file.
- return base::FilePath(base::SysNSStringToUTF8(name) + ".pak");
+ // Trying to load a resources file that doesn't exist is an error. Return
+ // just the name of the pack file so that further down the line it is easier
+ // to track down what happened.
+ std::string name_string = base::SysNSStringToUTF8(name);
+ std::string locale_string = base::SysNSStringToUTF8(mac_locale);
+ LOG(ERROR) << "Tried to get the file path of a non-existent pak file '"
+ << name_string << "' for locale '" << locale_string << "'";
+ return base::FilePath(name_string + ".pak");
}
return base::FilePath([resource_path fileSystemRepresentation]);
}

Powered by Google App Engine
This is Rietveld 408576698