Bug 1492326, revert some of bug 1478372, so that callers need to get the custom interface from a custom element without using QueryInterface, r=peterv

This commit is contained in:
Neil Deakin
2018-12-04 11:33:06 -05:00
parent 3acf83c461
commit fee1676951
3 changed files with 11 additions and 12 deletions

View File

@@ -200,7 +200,8 @@ const MozElementMixin = Base => class MozElement extends Base {
/**
* Indicate that a class defining a XUL element implements one or more
* XPCOM interfaces by adding a getCustomInterface implementation to it.
* XPCOM interfaces by adding a getCustomInterface implementation to it,
* as well as an implementation of QueryInterface.
*
* The supplied class should implement the properties and methods of
* all of the interfaces that are specified.
@@ -218,6 +219,7 @@ const MozElementMixin = Base => class MozElement extends Base {
}
cls.prototype.customInterfaceNumbers = numbers;
cls.prototype.QueryInterface = ChromeUtils.generateQI(ifaces);
cls.prototype.getCustomInterfaceCallback = function getCustomInterfaceCallback(iface) {
if (numbers.has(iface.number)) {
return getInterfaceProxy(this);