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

Unified Diff: chrome/browser/chromeos/login/user_image_loader.cc

Issue 264483004: UserImageLoader: Remove DCHECK requiring success of ReadFileToString(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add logging as suggested by Pavel. Created 6 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 | « chrome/browser/chromeos/login/user_image_loader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/user_image_loader.cc
diff --git a/chrome/browser/chromeos/login/user_image_loader.cc b/chrome/browser/chromeos/login/user_image_loader.cc
index 3087fd7bbfe81393bc9dfb8aaece60ca3480b333..e9f1b5c15f7f3a843758fcdf559ec01982683e70 100644
--- a/chrome/browser/chromeos/login/user_image_loader.cc
+++ b/chrome/browser/chromeos/login/user_image_loader.cc
@@ -67,10 +67,11 @@ void UserImageLoader::ReadAndDecodeImage(const ImageInfo& image_info) {
DCHECK(background_task_runner_->RunsTasksOnCurrentThread());
scoped_ptr<std::string> data(new std::string);
- const bool success =
- base::ReadFileToString(base::FilePath(image_info.file_path), data.get());
- DCHECK(success);
+ if (!base::ReadFileToString(base::FilePath(image_info.file_path), data.get()))
+ LOG(ERROR) << "Failed to read image " << image_info.file_path;
+ // In case ReadFileToString() fails, |data| is empty and DecodeImage() calls
+ // back to OnDecodeImageFailed().
DecodeImage(data.Pass(), image_info);
}
« no previous file with comments | « chrome/browser/chromeos/login/user_image_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698