[webkit-reviews] review granted: [Bug 119769] Stop using DEFINE_STATIC_LOCAL with RefPtr : [Attachment 208677] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Aug 13 14:35:28 PDT 2013
Andreas Kling <akling at apple.com> has granted Anders Carlsson
<andersca at apple.com>'s request for review:
Bug 119769: Stop using DEFINE_STATIC_LOCAL with RefPtr
https://bugs.webkit.org/show_bug.cgi?id=119769
Attachment 208677: Patch
https://bugs.webkit.org/attachment.cgi?id=208677&action=review
------- Additional Comments from Andreas Kling <akling at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=208677&action=review
r=me, but...
It'd be nice to make the methods that never return null return references
instead of pointers.
> Source/WebCore/editing/EditingStyle.cpp:1431
> - DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, underline,
(CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
> - DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, lineThrough,
(CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
> + static CSSPrimitiveValue* underline =
CSSPrimitiveValue::createIdentifier(CSSValueUnderline).leakRef();
> + static CSSPrimitiveValue* lineThrough =
CSSPrimitiveValue::createIdentifier(CSSValueLineThrough).leakRef();
This is silly, we should just use
cssValuePool().createIdentifierValue(CSSValueUnderline / CSSValueLineThrough)
for these instead. Save even more memory :)
More information about the webkit-reviews
mailing list