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

Side by Side Diff: lib/downloader.js

Issue 11239001: Use XMLHttpRequest constructor in JS modules (Closed)
Patch Set: Created July 25, 2013, 12:36 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 | « .hgsubstate ('k') | lib/io.js » ('j') | 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 this._download(downloadable, redirects + 1); 241 this._download(downloadable, redirects + 1);
242 }.bind(this); 242 }.bind(this);
243 } 243 }
244 244
245 this.onDownloadError(downloadable, downloadURL, error, channelStatus, re sponseStatus, redirectCallback); 245 this.onDownloadError(downloadable, downloadURL, error, channelStatus, re sponseStatus, redirectCallback);
246 } 246 }
247 }.bind(this); 247 }.bind(this);
248 248
249 try 249 try
250 { 250 {
251 request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci. nsIXMLHttpRequest); 251 request = new XMLHttpRequest();
252 request.mozBackgroundRequest = true; 252 request.mozBackgroundRequest = true;
253 request.open("GET", downloadURL); 253 request.open("GET", downloadURL);
254 } 254 }
255 catch (e) 255 catch (e)
256 { 256 {
257 errorCallback("synchronize_invalid_url"); 257 errorCallback("synchronize_invalid_url");
258 return; 258 return;
259 } 259 }
260 260
261 try { 261 try {
(...skipping 114 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 | « .hgsubstate ('k') | lib/io.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld