Closed Bug 1611173 Opened 4 years ago Closed 4 years ago

Remove support for non-nsISupports XPIDL interfaces

Categories

(Core :: XPConnect, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

In the new world of static XPCOM interfaces, I think we can get rid of nsXPConnect::IsISupportsDescendant(). There are only two uses of it.

For the first, we'd have to make sure that builtinclass is set for any interface that isn't an nsISupports. Hopefully that's already the case?

For the second, we'd have to make sure that the method count for any non-nsISupports descendant is 0. As before, hopefully this is implied by builtinclass.

So, maybe this is just a matter of confirming that the behavior is reasonable and then deleting the methods.

The Rust IDL bindings generator asserts that non-nsISupports interfaces have no attributes or methods, which means the second condition above already holds. It does feel a bit weird to enforce it there and not in xpidl.py.

It looks like we can actually enforce an even stronger invariant, though: we seem to have no non-nsISupports XPIDL interfaces! I wonder when the last one of those went away. (It was supported because you could define an XPIDL interface that only had constants, and you were allowed to use the constants but nothing else.)

I'd guess that Boris's de-COM work on DOM nodes took care of at least some of these non-nsISupports XPIDL interfaces. I recall there being a lot of constants in some of those interfaces.

Summary: Get rid of nsXPConnect::IsISupportsDescendant() → Remove support for non-nsISupports XPIDL interfaces

It used to be that some XPIDL interfaces were allowed to be non-nsISupports,
and were only used to hold a bunch of constants. It appears that we've now
had enough de-COM work happen that there are no longer any, so we can remove
support for this.

Assignee: nobody → continuation
Status: NEW → ASSIGNED
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/64c8ab5ec067
Remove support for non-nsISupports XPIDL interfaces. r=nika

I fixed the lint error, but I didn't see the second message before I queued the landing. So it may need to get re-backed out...

Flags: needinfo?(continuation)
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/27bd6308aff7
Remove support for non-nsISupports XPIDL interfaces. r=nika
Backout by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4387ba4db209
Backed out changeset 27bd6308aff7 for build bustages at runtests.py. CLOSED TREE
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f706b0ac9227
Remove support for non-nsISupports XPIDL interfaces. r=nika
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Regressions: 1611584
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: