Bug 1296097 - Use new XMLHttpRequest() instead of nsIXMLHttpRequest.

This commit is contained in:
Robert Strong 2016-08-18 12:03:38 -07:00
Родитель 61b954044b
Коммит 2caede3733
2 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -11,7 +11,6 @@ interface nsIDOMWindow;
interface nsIRequest;
interface nsIRequestObserver;
interface nsISimpleEnumerator;
interface nsIXMLHttpRequest;
interface nsIFile;
/**
@ -281,25 +280,25 @@ interface nsIUpdateCheckListener : nsISupports
/**
* The update check was completed.
* @param request
* The nsIXMLHttpRequest handling the update check.
* The XMLHttpRequest handling the update check.
* @param updates
* An array of nsIUpdate objects listing available updates.
* @param updateCount
* The size of the |updates| array.
*/
void onCheckComplete(in nsIXMLHttpRequest request,
void onCheckComplete(in jsval request,
[array, size_is(updateCount)] in nsIUpdate updates,
in unsigned long updateCount);
/**
* An error occurred while loading the remote update service file.
* @param request
* The nsIXMLHttpRequest handling the update check.
* The XMLHttpRequest handling the update check.
* @param update
* A nsIUpdate object that contains details about the
* error in its |statusText| property.
*/
void onError(in nsIXMLHttpRequest request,
void onError(in jsval request,
in nsIUpdate update);
};

Просмотреть файл

@ -14,6 +14,7 @@ Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://gre/modules/ctypes.jsm", this);
Cu.import("resource://gre/modules/UpdateTelemetry.jsm", this);
Cu.import("resource://gre/modules/AppConstants.jsm", this);
Cu.importGlobalProperties(["XMLHttpRequest"]);
const UPDATESERVICE_CID = Components.ID("{B3C290A6-3943-4B89-8BBE-C01EB7B3B311}");
const UPDATESERVICE_CONTRACTID = "@mozilla.org/updates/update-service;1";
@ -3361,8 +3362,7 @@ Checker.prototype = {
if (!url || (!this.enabled && !force))
return;
this._request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
createInstance(Ci.nsIXMLHttpRequest);
this._request = new XMLHttpRequest();
this._request.open("GET", url, true);
var allowNonBuiltIn = !getPref("getBoolPref",
PREF_APP_UPDATE_CERT_REQUIREBUILTIN, true);