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

Unified Diff: lib/io.js

Issue 11239001: Use XMLHttpRequest constructor in JS modules (Closed)
Patch Set: Created July 25, 2013, 12:36 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/downloader.js ('k') | lib/objectTabs.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/io.js
===================================================================
--- a/lib/io.js
+++ b/lib/io.js
@@ -67,17 +67,17 @@ let IO = exports.IO =
* The callback will be called when the operation is done.
*/
readFromFile: function(/**nsIFile|nsIURI*/ file, /**Boolean*/ decode, /**Object*/ listener, /**Function*/ callback, /**String*/ timeLineID)
{
try
{
let buffer = "";
let uri = file instanceof Ci.nsIFile ? Services.io.newFileURI(file) : file;
- let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
+ let request = new XMLHttpRequest();
request.mozBackgroundRequest = true;
request.open("GET", uri.spec);
request.responseType = "moz-chunked-text";
request.overrideMimeType("text/plain" + (decode ? "? charset=utf-8" : ""));
request.addEventListener("progress", function(event)
{
if (timeLineID)
« no previous file with comments | « lib/downloader.js ('k') | lib/objectTabs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld