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

Unified Diff: chrome/browser/resources/chromeos/wallpaper_manager/js/util.js

Issue 24040002: Fix unexpected error message when quickly select different wallpapers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/wallpaper_manager/js/util.js
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js
index bd63042c0d691dd03192d53d6998ba785264b643..4d07a5820c953cbf1145e5562b54f1b65457ea6f 100644
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js
@@ -58,13 +58,17 @@ WallpaperUtil.fetchURL = function(url, type, onSuccess, onFailure, opt_xhr) {
xhr = new XMLHttpRequest();
try {
- xhr.addEventListener('loadend', function(e) {
+ // Do not use loadend here to handle both success and failure case. It gets
+ // complicated with abortion. Unexpected error message may show up. See
+ // http://crbug.com/242581.
+ xhr.addEventListener('load', function(e) {
if (this.status == 200) {
onSuccess(this);
} else {
onFailure();
}
});
+ xhr.addEventListener('error', onFailure);
xhr.open('GET', url, true);
xhr.responseType = type;
xhr.send(null);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698