Gecko:DeCOMtamination: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 20: Line 20:
* in many cases we have a singleton interface like nsIComboboxControlFrame that is only implemented by one class, is not defined in IDL (and is therefore not scriptable), and is not visible outside Gecko. In these cases we can save code and data size by eliminating the interface, moving its methods to the concrete class and devirtualizing them, and casting to the class directly, like we just did with nsGfxButtonControlFrame. We can even assign the class an IID so you can get to it with QueryInterface. For example you can QI to nsBlockFrame this way.
* in many cases we have a singleton interface like nsIComboboxControlFrame that is only implemented by one class, is not defined in IDL (and is therefore not scriptable), and is not visible outside Gecko. In these cases we can save code and data size by eliminating the interface, moving its methods to the concrete class and devirtualizing them, and casting to the class directly, like we just did with nsGfxButtonControlFrame. We can even assign the class an IID so you can get to it with QueryInterface. For example you can QI to nsBlockFrame this way.
* Not really deCOMtamination, but we have new methods nsIContent::AttrValueIs and nsIContent::FindAttrValueIn that can be used in many many places where nsIContent::GetAttr is currently used. The new methods reduce code size and are faster. We need to convert GetAttr calls to use the new methods.
* Not really deCOMtamination, but we have new methods nsIContent::AttrValueIs and nsIContent::FindAttrValueIn that can be used in many many places where nsIContent::GetAttr is currently used. The new methods reduce code size and are faster. We need to convert GetAttr calls to use the new methods.
* nsIFrameSelection needs to be deCOMtaminated, and the interface should be removed.
* Not really deCOMtamination: every nsDisplayItem subclass declares its own mFrame. Move these mFrames up to nsDisplayItem, make it nsIFrame*, make GetUnderlyingFrame() nonvirtual and inline, and use NS_STATIC_CAST wherever the nsDisplayItem subclasses need to get the frame with the right type.
* Not really deCOMtamination, but code cleanup: nsGlobalWindow.cpp contains many copies of code to get the current JSContext (search for ncc->GetJSContext()). This code should be shared in a helper function.
1,295

edits