mozilla::dom::EventTarget should have utility methods to avoid QI
Categories
(Core :: DOM: Events, enhancement, P3)
Tracking
()
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(2 files)
Updated•7 years ago
|
| Assignee | ||
Comment 1•4 years ago
|
||
Currently, checking whether an EventTarget is nsINode (or its concrete
classes) or not requires a QI, but it's expensive and used a lot while we
handle each event. Therefore, it'd be nicer for creating a virtual method,
EventTarget::IsNode() and use it for the check.
If trying to convert EventTarget to a concrete class, it may require two
virtual method calls. I'm not sure whether it's cheaper than a QI, but at
least, it won't depend on the UUID check order of QueryInterface() when
multiple interfaces are implemented.
Updated•4 years ago
|
| Assignee | ||
Comment 2•4 years ago
|
||
Similar to the previous patch, there are a lot of QI from EventTarget to
window interfaces. This patch adds them, but unfortunately,
nsPIDOMWindowInner and nsPIDOMWindowOuter do not inherit EventTarget
directly, and they are in a public header instead of their concrete classes
(nsGlobalWindowInner and nsGlobalWindowOuter). So we cannot cast them
in nsPIDOMWindow.h, and it causes it's impossible to use the macros added
by the previous patch.
Depends on D129781
Comment 4•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ad00dd869711
https://hg.mozilla.org/mozilla-central/rev/27cd1206ecd9
| Assignee | ||
Comment 5•4 years ago
|
||
Posted to dev-platform: https://groups.google.com/a/mozilla.org/g/dev-platform/c/sKcNy_s11Is
Updated•4 years ago
|
Description
•