Open
Bug 1425619
Opened 7 years ago
Updated 2 years ago
Reduce use of getInterface in frontend code
Categories
(Firefox :: General, enhancement, P3)
Firefox
General
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox59 | --- | affected |
People
(Reporter: Gijs, Unassigned)
References
(Blocks 1 open bug)
Details
getInterface is not great for several reasons. Long-term, from what I understand, we would like to get rid of it.
Happily, a lot of the uses in frontend code have non-XPCOM-y equivalents via webidl properties or direct getters that don't require getInterface.
Where they don't, we should consider adding some (e.g. we should consider what we use DOMWindowUtils methods for and maybe add them directly to Element.webidl as [ChromeOnly] methods).
This would be a good idea both for perf and for ergonomics and cleaning up hard to read goop from our code, like atrocities such as:
window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem).treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow)
.XULBrowserWindow = window.XULBrowserWindow;
etc.
Florian, my understanding is that you have scripts that would help with this. Can you attach an example, perhaps?
Flags: needinfo?(florian)
Comment 1•7 years ago
|
||
All my rewrite scripts are in https://bitbucket.org/fqueze/xpcshell-rewrites/src
Flags: needinfo?(florian)
Priority: -- → P3
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•