fx-compat: XPCOMUtils.generateQI() → ChromeUtils.generateQI()

This commit is contained in:
Dan Stillman 2020-06-30 02:08:08 -04:00
parent 4d35cdf095
commit ccbc785499
8 changed files with 12 additions and 17 deletions

View file

@ -323,8 +323,8 @@ Zotero.HTTP = new function() {
// Don't follow redirects // Don't follow redirects
if (options.followRedirects === false) { if (options.followRedirects === false) {
channel.notificationCallbacks = { channel.notificationCallbacks = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIInterfaceRequestor, Ci.nsIChannelEventSync]), QueryInterface: ChromeUtils.generateQI([Ci.nsIInterfaceRequestor, Ci.nsIChannelEventSync]),
getInterface: XPCOMUtils.generateQI([Ci.nsIChannelEventSink]), getInterface: ChromeUtils.generateQI([Ci.nsIChannelEventSink]),
asyncOnChannelRedirect: function (oldChannel, newChannel, flags, callback) { asyncOnChannelRedirect: function (oldChannel, newChannel, flags, callback) {
redirectStatus = (flags & Ci.nsIChannelEventSink.REDIRECT_PERMANENT) ? 301 : 302; redirectStatus = (flags & Ci.nsIChannelEventSink.REDIRECT_PERMANENT) ? 301 : 302;
redirectLocation = newChannel.URI.spec; redirectLocation = newChannel.URI.spec;

View file

@ -3483,7 +3483,7 @@ Zotero.Integration.LegacyPluginWrapper.wrapDocument = function wrapDocument(doc)
deferred.reject(data); deferred.reject(data);
deferred = null; deferred = null;
} }
}, QueryInterface:XPCOMUtils.generateQI([Components.interfaces.nsIObserver, Components.interfaces.nsISupports])}); }, QueryInterface:ChromeUtils.generateQI([Components.interfaces.nsIObserver])});
return promise; return promise;
} else { } else {
var result = doc.getFields.apply(doc, arguments); var result = doc.getFields.apply(doc, arguments);

View file

@ -1826,7 +1826,7 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
* @namespace * @namespace
*/ */
var ConsoleListener = { var ConsoleListener = {
"QueryInterface":XPCOMUtils.generateQI([Components.interfaces.nsIConsoleMessage, "QueryInterface":ChromeUtils.generateQI([Components.interfaces.nsIConsoleMessage,
Components.interfaces.nsISupports]), Components.interfaces.nsISupports]),
"observe":function(msg) { "observe":function(msg) {
if(!_shouldKeepError(msg)) return; if(!_shouldKeepError(msg)) return;

View file

@ -356,9 +356,9 @@ ZoteroAutoComplete.prototype.stopSearch = function(){
ZoteroAutoComplete.prototype.classDescription = ZOTERO_AC_CLASSNAME; ZoteroAutoComplete.prototype.classDescription = ZOTERO_AC_CLASSNAME;
ZoteroAutoComplete.prototype.classID = ZOTERO_AC_CID; ZoteroAutoComplete.prototype.classID = ZOTERO_AC_CID;
ZoteroAutoComplete.prototype.contractID = ZOTERO_AC_CONTRACTID; ZoteroAutoComplete.prototype.contractID = ZOTERO_AC_CONTRACTID;
ZoteroAutoComplete.prototype.QueryInterface = XPCOMUtils.generateQI([ ZoteroAutoComplete.prototype.QueryInterface = ChromeUtils.generateQI([
Components.interfaces.nsIAutoCompleteSearch, Components.interfaces.nsIAutoCompleteSearch,
Components.interfaces.nsIAutoCompleteObserver, Components.interfaces.nsIAutoCompleteObserver
Components.interfaces.nsISupports]); ]);
var NSGetFactory = XPCOMUtils.generateNSGetFactory([ZoteroAutoComplete]); var NSGetFactory = XPCOMUtils.generateNSGetFactory([ZoteroAutoComplete]);

View file

@ -1330,8 +1330,7 @@ ZoteroProtocolHandler.prototype = {
contractID: ZOTERO_PROTOCOL_CONTRACTID, contractID: ZOTERO_PROTOCOL_CONTRACTID,
classDescription: ZOTERO_PROTOCOL_NAME, classDescription: ZOTERO_PROTOCOL_NAME,
classID: ZOTERO_PROTOCOL_CID, classID: ZOTERO_PROTOCOL_CID,
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsISupports, QueryInterface: ChromeUtils.generateQI([Components.interfaces.nsIProtocolHandler])
Components.interfaces.nsIProtocolHandler])
}; };

View file

@ -438,13 +438,11 @@ function ZoteroService() {
throw e; throw e;
} }
} }
ZoteroService.prototype = { ZoteroService.prototype = {
contractID: '@zotero.org/Zotero;1', contractID: '@zotero.org/Zotero;1',
classDescription: 'Zotero', classDescription: 'Zotero',
classID: Components.ID('{e4c61080-ec2d-11da-8ad9-0800200c9a66}'), classID: Components.ID('{e4c61080-ec2d-11da-8ad9-0800200c9a66}'),
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsISupports, QueryInterface: ChromeUtils.generateQI([])
Components.interfaces.nsIProtocolHandler])
} }
function addInitCallback(callback) { function addInitCallback(callback) {
@ -657,8 +655,7 @@ ZoteroCommandLineHandler.prototype = {
classID: Components.ID("{531828f8-a16c-46be-b9aa-14845c3b010f}"), classID: Components.ID("{531828f8-a16c-46be-b9aa-14845c3b010f}"),
service: true, service: true,
_xpcom_categories: [{category:"command-line-handler", entry:"m-zotero"}], _xpcom_categories: [{category:"command-line-handler", entry:"m-zotero"}],
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler, QueryInterface: ChromeUtils.generateQI([Components.interfaces.nsICommandLineHandler])
Components.interfaces.nsISupports])
}; };
var NSGetFactory = XPCOMUtils.generateNSGetFactory([ZoteroService, ZoteroCommandLineHandler]); var NSGetFactory = XPCOMUtils.generateNSGetFactory([ZoteroService, ZoteroCommandLineHandler]);

View file

@ -281,7 +281,7 @@ const urlCache = {
} }
}), }),
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference]), QueryInterface: ChromeUtils.generateQI([Ci.nsISupportsWeakReference]),
observe() { observe() {
// Clear any module resolution caches when the startup cache is flushed, // Clear any module resolution caches when the startup cache is flushed,

View file

@ -52,8 +52,7 @@ ZoteroUnit.prototype = {
classID: Components.ID("{b8570031-be5e-46e8-9785-38cd50a5d911}"), classID: Components.ID("{b8570031-be5e-46e8-9785-38cd50a5d911}"),
service: true, service: true,
_xpcom_categories: [{category:"command-line-handler", entry:"m-zotero-unit"}], _xpcom_categories: [{category:"command-line-handler", entry:"m-zotero-unit"}],
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler, QueryInterface: ChromeUtils.generateQI([Components.interfaces.nsICommandLineHandler])
Components.interfaces.nsISupports])
}; };