[webkit-reviews] review granted: [Bug 115765] Begin unraveling the mess that is QuoteData : [Attachment 200987] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 7 15:40:28 PDT 2013


Andreas Kling <akling at apple.com> has granted Anders Carlsson
<andersca at apple.com>'s request for review:
Bug 115765: Begin unraveling the mess that is QuoteData
https://bugs.webkit.org/show_bug.cgi?id=115765

Attachment 200987: Patch
https://bugs.webkit.org/attachment.cgi?id=200987&action=review

------- Additional Comments from Andreas Kling <akling at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=200987&action=review


r=me, but you'll need to unbreak the RenderStyle optimization.

> Source/WebCore/ChangeLog:3
> +	   Begin unraveling the mess that is QuoteData

QuoteData => QuotesData

> Source/WebCore/rendering/style/QuotesData.cpp:30
> +    quotes.reserveCapacity(2);

You should use reserveInitialCapacity() here.

> Source/WebCore/rendering/style/QuotesData.h:35
> +    static PassRefPtr<QuotesData> create(const Vector<std::pair<String,
String> >& quotes);

This could also be QuotesData::adopt(Voctor<>&) and use swap() to avoid copying
the data.

> Source/WebCore/rendering/style/RenderStyle.cpp:755
> -    if (QuotesData::equals(rareInheritedData->quotes.get(), q.get()))
> -	   return;
>      rareInheritedData.access()->quotes = q;

You are removing an optimization here!
rareInheritedData.access() is DataRef<T>'s copy-on-write accessor, this means
that setQuotes() will always detach from shared rareInheritedData.


More information about the webkit-reviews mailing list