Summary: | Stop using DEFINE_STATIC_LOCAL with RefPtr | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||
Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | ||||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Anders Carlsson
2013-08-13 14:25:43 PDT
Created attachment 208677 [details]
Patch
Comment on attachment 208677 [details] Patch 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 :) Committed r154023: <http://trac.webkit.org/changeset/154023> |