Open
Bug 1247024
Opened 9 years ago
Updated 2 years ago
[meta] remove nsIInterfaceRequestor
Categories
(Core :: XPCOM, task)
Core
XPCOM
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox47 | --- | affected |
People
(Reporter: dbaron, Unassigned)
Details
(Keywords: meta)
I'm not planning to work on this right now, however:
I think it would be a good long-term goal to remove nsIInterfaceRequestor. I believe its existence was basically a mistake. It was a convenient way to add a "getter" (with bad ergonomics) to something without modifying a (potentially binary-frozen) interface. But in the absence of frozen interfaces, I don't think it should exist anymore.
Getting rid of it is somewhat difficult, though. Basically, each use of it would need to be converted to a getter on some interface the object implements. So for each use, the usage pattern would need to be audited, and appropriate changes made.
Thus this bug is a meta-bug.
Comment 1•9 years ago
|
||
I think doing this is tied up in our addon story, because something like:
// XXX: _getBrowserWindowForContentWindow and _getBrowserForContentWindow
// were taken from browser/components/feeds/WebContentConverter.
_getBrowserWindowForContentWindow: function(aContentWindow) {
return aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
.wrappedJSObject;
},
is extremely common in our browser code, and probably equally pervasive in our addons.
Maybe that's just proving the point that we should find better ways to expose things than QI/getInterface chains (which are expensive anyway).
Reporter | ||
Comment 2•9 years ago
|
||
Agreed that it's tied to addon api stability.
I think that with this bug fixed, something like that should probably look like:
return aContentWindow.webNavigation.rootTreeItem.window.wrappedJSObject;
possibly with a few QueryInterface calls in the middle.
Comment 3•9 years ago
|
||
Since the goal is to get rid of XPCOM-using addons over the course of the next year (?), and this is clearly a longer-term problem, perhaps that doesn't matter so much.
Updated•6 years ago
|
Type: defect → task
Updated•6 years ago
|
Summary: remove nsIInterfaceRequestor → [meta] remove nsIInterfaceRequestor
Comment 4•4 years ago
|
||
The meta keyword is there, the bug doesn't depend on other bugs and there is no activity for 12 months.
:froydnj, maybe it's time to close this bug?
Flags: needinfo?(nfroyd)
Comment 5•4 years ago
|
||
I mean, we should still do this, and it's probably got easier now that our addon story is better.
Flags: needinfo?(nfroyd)
Comment 6•3 years ago
|
||
The meta keyword is there, the bug doesn't depend on other bugs and there is no activity for 12 months.
:nika, maybe it's time to close this bug?
Flags: needinfo?(nika)
Comment 7•3 years ago
|
||
(In reply to Nathan Froyd [:froydnj] from comment #5)
I mean, we should still do this, and it's probably got easier now that our addon story is better.
Flags: needinfo?(nika)
Comment 8•2 years ago
|
||
The meta keyword is there, the bug doesn't depend on other bugs and there is no activity for 12 months.
:nika, maybe it's time to close this bug?
Flags: needinfo?(nika)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•