Avoid QI between transaction classes
Categories
(Core :: DOM: Editor, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
Each transaction class should have GetAs*Transaction()
methods for easier and faster access to concrete classes.
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
In a lot of places in libeditor, we do nothing if given transaction is not
our edit transaction classes' instance. Therefore, it's better to have
casting virtual method in nsITransaction
for performance because QI cost
may not be cheap.
Depends on D71907
Assignee | ||
Comment 3•5 years ago
|
||
It's inherited only by PlaceholderTransaction
and used only for QI.
Therefore, we can get rid of it.
Additionally, this makes storing PlaceholderTransaction
and
CompositionTransaction
in PlaceholderTransaction
faster and safer with
WeakPtr
.
Finally, this makes PlaceholderTransaction
always have non-null name
because it caused a lot of useless warnings in
EditAggregationTransaction::GetName()
and
PlaceholderTransaction::GetTxnName()
.
Depends on D71908
Assignee | ||
Comment 4•5 years ago
|
||
EditTransactionBase::GetAs*Transaction()
should be used instead.
Depends on D71910
Comment 6•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9e2e2b767d83
https://hg.mozilla.org/mozilla-central/rev/a4a7fce9f73e
https://hg.mozilla.org/mozilla-central/rev/946dc2965175
https://hg.mozilla.org/mozilla-central/rev/55abc248f524
Description
•