Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/downloader.js

Issue 11292041: Use XMLHttpRequest.status instead of nsIHttpChannel.responseStatus(same value, better cross-browse… (Closed)
Patch Set: Created July 29, 2013, 1:45 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 let request = null; 211 let request = null;
212 212
213 let errorCallback = function errorCallback(error) 213 let errorCallback = function errorCallback(error)
214 { 214 {
215 let channelStatus = -1; 215 let channelStatus = -1;
216 try 216 try
217 { 217 {
218 channelStatus = request.channel.status; 218 channelStatus = request.channel.status;
219 } catch (e) {} 219 } catch (e) {}
220 220
221 let responseStatus = ""; 221 let responseStatus = -1;
222 try 222 try
223 { 223 {
224 responseStatus = request.channel.QueryInterface(Ci.nsIHttpChannel).respo nseStatus; 224 responseStatus = request.status;
Thomas Greiner 2013/07/31 12:34:45 You don't need a try/catch here anymore. You can s
Wladimir Palant 2013/07/31 13:31:26 I verified that the Mozilla implementation indeed
225 } catch (e) {} 225 } catch (e) {}
226 226
227 Cu.reportError("Adblock Plus: Downloading URL " + downloadable.url + " fai led (" + error + ")\n" + 227 Cu.reportError("Adblock Plus: Downloading URL " + downloadable.url + " fai led (" + error + ")\n" +
228 "Download address: " + downloadURL + "\n" + 228 "Download address: " + downloadURL + "\n" +
229 "Channel status: " + channelStatus + "\n" + 229 "Channel status: " + channelStatus + "\n" +
230 "Server response: " + responseStatus); 230 "Server response: " + responseStatus);
231 231
232 if (this.onDownloadError) 232 if (this.onDownloadError)
233 { 233 {
234 // Allow one extra redirect if the error handler gives us a redirect URL 234 // Allow one extra redirect if the error handler gives us a redirect URL
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 * @type Integer 376 * @type Integer
377 */ 377 */
378 softExpiration: 0, 378 softExpiration: 0,
379 379
380 /** 380 /**
381 * Hard expiration interval, this is fixed. 381 * Hard expiration interval, this is fixed.
382 * @type Integer 382 * @type Integer
383 */ 383 */
384 hardExpiration: 0, 384 hardExpiration: 0,
385 }; 385 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld