Skip to content

Commit

Permalink
Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to Chr…
Browse files Browse the repository at this point in the history
…omeUtils.generateQI. r=mccr8

This also removes any redundant Ci.nsISupports elements in the interface
lists.

This was done using the following script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/acecb401b76cfcc6ff7f0ba3ae69929955716152/processors/chromeutils-generateQI.jsm

MozReview-Commit-ID: AIx10P8GpZY

--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
  • Loading branch information
kmaglione committed Apr 23, 2018
1 parent 1b96577 commit a259026
Show file tree
Hide file tree
Showing 460 changed files with 944 additions and 1,002 deletions.
2 changes: 1 addition & 1 deletion accessible/jsat/ContentControl.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ this.ContentControl.prototype = {
this._autoMove = 0;
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference,
QueryInterface: ChromeUtils.generateQI([Ci.nsISupportsWeakReference,
Ci.nsIMessageListener
])
};
5 changes: 1 addition & 4 deletions accessible/jsat/EventManager.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,7 @@ this.EventManager.prototype = {
this.present(Presentation.tabStateChanged(docAcc, "newdoc"));
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
Ci.nsISupportsWeakReference,
Ci.nsISupports,
Ci.nsIObserver])
QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener, Ci.nsISupportsWeakReference, Ci.nsIObserver])
};

const AccessibilityEventObserver = {
Expand Down
2 changes: 1 addition & 1 deletion accessible/jsat/Traversal.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ BaseTraversalRule.prototype = {
return matchResult;
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsIAccessibleTraversalRule])
QueryInterface: ChromeUtils.generateQI([Ci.nsIAccessibleTraversalRule])
};

var gSimpleTraversalRoles =
Expand Down
4 changes: 2 additions & 2 deletions accessible/jsat/Utils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,6 @@ PrefCache.prototype = {
}
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference])
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference])
};
4 changes: 2 additions & 2 deletions accessible/tests/mochitest/pivot.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var HeadersTraversalRule =
return FILTER_MATCH;
},

QueryInterface: XPCOMUtils.generateQI([nsIAccessibleTraversalRule])
QueryInterface: ChromeUtils.generateQI([nsIAccessibleTraversalRule])
};

/**
Expand Down Expand Up @@ -62,7 +62,7 @@ var ObjectTraversalRule =
return rv;
},

QueryInterface: XPCOMUtils.generateQI([nsIAccessibleTraversalRule])
QueryInterface: ChromeUtils.generateQI([nsIAccessibleTraversalRule])
};

// //////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/browser-data-submission-info-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var gDataNotificationInfoBar = {
}
},

QueryInterface: XPCOMUtils.generateQI([
QueryInterface: ChromeUtils.generateQI([
Ci.nsIObserver,
Ci.nsISupportsWeakReference,
]),
Expand Down
4 changes: 2 additions & 2 deletions browser/base/content/browser-feeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ var FeedHandler = {

// nsISupports

QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),


init() {
Expand Down
5 changes: 1 addition & 4 deletions browser/base/content/browser-fullZoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ var FullZoom = {

// nsISupports

QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsIContentPrefObserver,
Ci.nsISupportsWeakReference,
Ci.nsISupports]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver, Ci.nsIContentPrefObserver, Ci.nsISupportsWeakReference]),

// Initialization & Destruction

Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/browser-places.js
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ var BookmarkingUI = {
this._uninitView();
},

QueryInterface: XPCOMUtils.generateQI([
QueryInterface: ChromeUtils.generateQI([
Ci.nsINavBookmarkObserver
])
};
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/browser-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ var gSync = {
}
},

QueryInterface: XPCOMUtils.generateQI([
QueryInterface: ChromeUtils.generateQI([
Ci.nsIObserver,
Ci.nsISupportsWeakReference
])
Expand Down
6 changes: 3 additions & 3 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5384,7 +5384,7 @@ var TabsProgressListener = {
function nsBrowserAccess() { }

nsBrowserAccess.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserDOMWindow, Ci.nsISupports]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIBrowserDOMWindow]),

_openURIInNewTab(aURI, aReferrer, aReferrerPolicy, aIsPrivate,
aIsExternal, aForceNotRemote = false,
Expand Down Expand Up @@ -7740,8 +7740,8 @@ var RestoreLastSessionObserver = {
goSetCommandEnabled("Browser:RestoreLastSession", false);
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference])
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference])
};

function restoreLastSession() {
Expand Down
4 changes: 2 additions & 2 deletions browser/base/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -1524,8 +1524,8 @@ let OfflineApps = {
}
}
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
};

addEventListener("MozApplicationManifest", OfflineApps, false);
Expand Down
5 changes: 1 addition & 4 deletions browser/base/content/tab-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,7 @@ var RefreshBlocker = {
}
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener2,
Ci.nsIWebProgressListener,
Ci.nsISupportsWeakReference,
Ci.nsISupports]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener2, Ci.nsIWebProgressListener, Ci.nsISupportsWeakReference]),
};

RefreshBlocker.init();
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/test/about/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function waitForDocLoadAndStopIt(aExpectedURL, aBrowser = gBrowser.selectedBrows
stopContent(contentStopFromProgressListener, chan.originalURI.spec);
}
},
QueryInterface: XPCOMUtils.generateQI(["nsISupportsWeakReference"])
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"])
};
wp.addProgressListener(progressListener, wp.NOTIFY_STATE_WINDOW);

Expand Down
4 changes: 2 additions & 2 deletions browser/base/content/test/chrome/test_aboutCrashed.xul
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
}
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
Ci.nsISupportsWeakReference])
QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
Ci.nsISupportsWeakReference])
};
frame.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/test/general/browser_bug356571.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var fakePromptServiceFactory = {
};

var promptService = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPromptService]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIPromptService]),
alert() {
didFail = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ AboutModule.prototype = {
return null;
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule])
QueryInterface: ChromeUtils.generateQI([Ci.nsIAboutModule])
};

var AboutModuleFactory = {
Expand All @@ -60,7 +60,7 @@ var AboutModuleFactory = {
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory])
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory])
};

add_task(async function init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,5 @@ WindowListener.prototype = {
domwindow.addEventListener("load", onLoad, true);
},
onCloseWindow(aXULWindow) {},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowMediatorListener,
Ci.nsISupports]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIWindowMediatorListener]),
};
2 changes: 1 addition & 1 deletion browser/base/content/test/general/browser_homeDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ add_task(async function() {

let setHomepagePromise = new Promise(function(resolve) {
let observer = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
observe(subject, topic, data) {
is(topic, "nsPref:changed", "observed correct topic");
is(data, HOMEPAGE_PREF, "observed correct data");
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/test/general/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ function promiseOnBookmarkItemAdded(aExpectedURI) {
onItemChanged() {},
onItemVisited() {},
onItemMoved() {},
QueryInterface: XPCOMUtils.generateQI([
QueryInterface: ChromeUtils.generateQI([
Ci.nsINavBookmarkObserver,
])
};
Expand Down
4 changes: 2 additions & 2 deletions browser/base/content/test/performance/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ async function recordReflows(testPromise, win = window) {
// driver ticking. These are fine.
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsIReflowObserver,
Ci.nsISupportsWeakReference])
QueryInterface: ChromeUtils.generateQI([Ci.nsIReflowObserver,
Ci.nsISupportsWeakReference])
};

let docShell = win.QueryInterface(Ci.nsIInterfaceRequestor)
Expand Down
6 changes: 3 additions & 3 deletions browser/base/content/test/plugins/blocklist_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ SimpleTest.requestFlakyTimeout("Need to simulate blocklist calls actually taking
var BlocklistProxy = {
_uuid: null,

QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsIBlocklistService,
Ci.nsITimerCallback]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
Ci.nsIBlocklistService,
Ci.nsITimerCallback]),

init() {
if (!this._uuid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function checkAutocompleteResults(aExpected, aCallback) {
setSelectedIndex() {},
get searchCount() { return this.searches.length; },
getSearchAt(aIndex) { return this.searches[aIndex]; },
QueryInterface: XPCOMUtils.generateQI([
QueryInterface: ChromeUtils.generateQI([
Ci.nsIAutoCompleteInput,
Ci.nsIAutoCompletePopup,
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const clientAuthDialogs = {
return true;
},

QueryInterface: XPCOMUtils.generateQI([Ci.nsIClientAuthDialogs]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIClientAuthDialogs]),
};

function startServer(cert) {
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/test/urlbar/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function waitForDocLoadAndStopIt(aExpectedURL, aBrowser = gBrowser.selectedBrows
stopContent(contentStopFromProgressListener, chan.originalURI.spec);
}
},
QueryInterface: XPCOMUtils.generateQI(["nsISupportsWeakReference"])
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"])
};
wp.addProgressListener(progressListener, wp.NOTIFY_STATE_WINDOW);

Expand Down
3 changes: 1 addition & 2 deletions browser/components/about/nsAboutCapabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ nsAboutCapabilities.prototype = {

contractID: "@mozilla.org/aboutcapabilities;1",
classID: Components.ID("{4c2b1f46-e637-4a91-8108-8a9fb7aab91d}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
Ci.nsIDOMGlobalPropertyInitializer])
QueryInterface: ChromeUtils.generateQI([Ci.nsIDOMGlobalPropertyInitializer])
};

this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsAboutCapabilities]);
4 changes: 2 additions & 2 deletions browser/components/downloads/DownloadsCommon.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ const kMaxHistoryResultsForLimitedView = 42;
const kPrefBranch = Services.prefs.getBranch("browser.download.");

var PrefObserver = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
getPref(name) {
try {
switch (typeof this.prefs[name]) {
Expand Down
6 changes: 3 additions & 3 deletions browser/components/enterprisepolicies/EnterprisePolicies.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ function EnterprisePoliciesManager() {
EnterprisePoliciesManager.prototype = {
// for XPCOM
classID: Components.ID("{ea4e1414-779b-458b-9d1f-d18e8efbc145}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsIEnterprisePolicies]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsIEnterprisePolicies]),

// redefine the default factory for XPCOMUtils
_xpcom_factory: EnterprisePoliciesFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function EnterprisePoliciesManagerContent() {
EnterprisePoliciesManagerContent.prototype = {
// for XPCOM
classID: Components.ID("{dc6358f8-d167-4566-bf5b-4350b5e6a7a2}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIEnterprisePolicies]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIEnterprisePolicies]),

// redefine the default factory for XPCOMUtils
_xpcom_factory: EnterprisePoliciesFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ function WebsiteFilter(blocklist, exceptionlist) {
}

WebsiteFilter.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),

observe(subject, topic, data) {
let channel, isDocument = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ add_task(async function test_AddSearchProvider() {
alert() {
this.promptCount++;
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPrompt]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIPrompt]),
};
let windowWatcher = {
getNewPrompter: () => mockPrompter,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowWatcher]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIWindowWatcher]),
};
let origWindowWatcher = Services.ww;
Services.ww = windowWatcher;
Expand Down
2 changes: 1 addition & 1 deletion browser/components/extensions/parent/ext-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ this.tabs = class extends ExtensionAPI {
resolve(retval == 0 ? "not_saved" : "not_replaced");
}
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener]),
};

activeTab.linkedBrowser.print(activeTab.linkedBrowser.outerWindowID, printSettings, printProgressListener);
Expand Down
4 changes: 2 additions & 2 deletions browser/components/feeds/FeedWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,8 @@ FeedWriter.prototype = {
},

classID: FEEDWRITER_CID,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsIDOMGlobalPropertyInitializer])
QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
Ci.nsIDOMGlobalPropertyInitializer])
};

this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]);
4 changes: 2 additions & 2 deletions browser/components/feeds/WebContentConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ WebContentConverterRegistrar.prototype = {
/**
* See nsISupports
*/
QueryInterface: XPCOMUtils.generateQI(
QueryInterface: ChromeUtils.generateQI(
[Ci.nsIWebContentConverterService,
Ci.nsIWebContentHandlerRegistrar,
Ci.nsIObserver,
Expand Down Expand Up @@ -1044,7 +1044,7 @@ WebContentConverterRegistrarContent.prototype = {
/**
* See nsISupports
*/
QueryInterface: XPCOMUtils.generateQI(
QueryInterface: ChromeUtils.generateQI(
[Ci.nsIWebContentHandlerRegistrar,
Ci.nsIWebContentConverterService,
Ci.nsIFactory])
Expand Down
2 changes: 1 addition & 1 deletion browser/components/migration/AutoMigrate.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ const AutoMigrate = {
chromeWindow.openTrustedLinkIn(url, "tab");
},

QueryInterface: XPCOMUtils.generateQI(
QueryInterface: ChromeUtils.generateQI(
[Ci.nsIObserver, Ci.nsINavBookmarkObserver, Ci.nsISupportsWeakReference]
),

Expand Down
2 changes: 1 addition & 1 deletion browser/components/migration/MigrationUtils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function getMigrationBundle() {
* 6. For startup-only migrators, override |startupOnlyMigrator|.
*/
var MigratorPrototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserProfileMigrator]),
QueryInterface: ChromeUtils.generateQI([Ci.nsIBrowserProfileMigrator]),

/**
* OVERRIDE IF AND ONLY IF the source supports multiple profiles.
Expand Down
Loading

0 comments on commit a259026

Please sign in to comment.