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

Delta Between Two Patch Sets: lib/downloader.js

Issue 11292041: Use XMLHttpRequest.status instead of nsIHttpChannel.responseStatus(same value, better cross-browse… (Closed)
Left Patch Set: Created July 29, 2013, 1:45 p.m.
Right Patch Set: Removed exception handling Created July 31, 2013, 1:29 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 = -1; 221 let responseStatus = request.status;
222 try
223 {
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) {}
226 222
227 Cu.reportError("Adblock Plus: Downloading URL " + downloadable.url + " fai led (" + error + ")\n" + 223 Cu.reportError("Adblock Plus: Downloading URL " + downloadable.url + " fai led (" + error + ")\n" +
228 "Download address: " + downloadURL + "\n" + 224 "Download address: " + downloadURL + "\n" +
229 "Channel status: " + channelStatus + "\n" + 225 "Channel status: " + channelStatus + "\n" +
230 "Server response: " + responseStatus); 226 "Server response: " + responseStatus);
231 227
232 if (this.onDownloadError) 228 if (this.onDownloadError)
233 { 229 {
234 // Allow one extra redirect if the error handler gives us a redirect URL 230 // Allow one extra redirect if the error handler gives us a redirect URL
235 let redirectCallback = null; 231 let redirectCallback = null;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 * @type Integer 372 * @type Integer
377 */ 373 */
378 softExpiration: 0, 374 softExpiration: 0,
379 375
380 /** 376 /**
381 * Hard expiration interval, this is fixed. 377 * Hard expiration interval, this is fixed.
382 * @type Integer 378 * @type Integer
383 */ 379 */
384 hardExpiration: 0, 380 hardExpiration: 0,
385 }; 381 };
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld