Bug 1230034 part 4 - Make FramePropertyDescriptor to be a template. r=froydnj,dbaron

This patch makes methods of FramePropertyTable and FrameProperties to be
simple template wrapper functions. Then it converts all references to
FramePropertyDescriptor to use "void" parameter to simulate the current
unsafe behavior.

SmallValueHolder is used for storing small values like int32_t, float,
which can fit in the size of a pointer directly, and thus no lifetime
management is needed.
This commit is contained in:
Xidorn Quan
2016-01-28 14:23:59 +11:00
parent 4dccb52f19
commit 8e2ada8719
14 changed files with 231 additions and 94 deletions

View File

@@ -5823,7 +5823,7 @@ AddGenConPseudoToFrame(nsIFrame* aOwnerFrame, nsIContent* aContent)
"property should only be set on first continuation/ib-sibling");
typedef nsAutoTArray<nsIContent*, 2> T;
const FramePropertyDescriptor* prop = nsIFrame::GenConProperty();
const FramePropertyDescriptor<>* prop = nsIFrame::GenConProperty();
FrameProperties props = aOwnerFrame->Properties();
T* value = static_cast<T*>(props.Get(prop));
if (!value) {