RESOLVED FIXED 93574
Convert CSSParser's m_reusableSelectorVector to OwnPtr and rename to m_selectorVector.
https://bugs.webkit.org/show_bug.cgi?id=93574
Summary Convert CSSParser's m_reusableSelectorVector to OwnPtr and rename to m_select...
Shane Stephens
Reported 2012-08-08 21:04:10 PDT
Convert CSSParser::m_reusableSelectorVector to OwnPtr and rename to m_selectorVector.
Attachments
Patch (30.48 KB, patch)
2012-08-08 21:22 PDT, Shane Stephens
no flags
Patch (30.83 KB, patch)
2012-08-08 22:49 PDT, Shane Stephens
no flags
Patch (31.17 KB, patch)
2012-08-08 23:33 PDT, Shane Stephens
no flags
Patch for landing (31.78 KB, patch)
2012-08-09 19:42 PDT, Shane Stephens
no flags
Shane Stephens
Comment 1 2012-08-08 21:22:46 PDT
Tony Chang
Comment 2 2012-08-08 22:03:41 PDT
Comment on attachment 157381 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=157381&action=review r- for the ChangeLog. After you upload a new patch, let's wait a day so people in other times zones can look and provide feedback. > Source/WebCore/ChangeLog:22 > + * css/CSSGrammar.y: > + * css/CSSParser.cpp: > + (WebCore::CSSParser::CSSParser): > + (WebCore::CSSParser::parseValue): > + (WebCore::CSSParser::parseColor): Please annotate some of the major changes here. For example, renaming reusableSelectorVector to selectorVector or where the typedef is added. > Source/WebCore/css/CSSParser.cpp:1159 > + declaration->addParsedProperties(*m_parsedProperties.get()); Nit: I don't think you need the .get(). > Source/WebCore/css/CSSParser.cpp:1250 > - declaration->addParsedProperties(m_parsedProperties); > + declaration->addParsedProperties(*m_parsedProperties.get()); Nit: I don't think you need the .get(). > Source/WebCore/css/CSSParserValues.h:109 > +typedef Vector<OwnPtr<CSSParserSelector> > CSSSelectorVector; If we moved this typedef into CSSParserSelector, would we have to say CSSParserSelector::CSSSelectorVector in many places?
Shane Stephens
Comment 3 2012-08-08 22:44:45 PDT
Comment on attachment 157381 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=157381&action=review >> Source/WebCore/ChangeLog:22 >> + (WebCore::CSSParser::parseColor): > > Please annotate some of the major changes here. For example, renaming reusableSelectorVector to selectorVector or where the typedef is added. Done. Most changes are pretty minor though. >> Source/WebCore/css/CSSParser.cpp:1159 >> + declaration->addParsedProperties(*m_parsedProperties.get()); > > Nit: I don't think you need the .get(). Done. >> Source/WebCore/css/CSSParser.cpp:1250 >> + declaration->addParsedProperties(*m_parsedProperties.get()); > > Nit: I don't think you need the .get(). Done. >> Source/WebCore/css/CSSParserValues.h:109 >> +typedef Vector<OwnPtr<CSSParserSelector> > CSSSelectorVector; > > If we moved this typedef into CSSParserSelector, would we have to say CSSParserSelector::CSSSelectorVector in many places? A rough count: 1 in CSSGrammar.y 7 in CSSParser.cpp, 9 in CSSParser.h 1 in CSSParserValues.cpp, 2 in CSSParserValues.h 1 in CSSSelectorList.cpp, 1 in CSSSelectorList.h 1 in StyleRule.cpp, 4 in StyleRule.h For a grand total of 27 places. Probably not worth moving?
Shane Stephens
Comment 4 2012-08-08 22:49:11 PDT
Tony Chang
Comment 5 2012-08-08 22:51:44 PDT
(In reply to comment #3) > For a grand total of 27 places. Probably not worth moving? Yeah, not worth moving.
Shane Stephens
Comment 6 2012-08-08 23:33:39 PDT
WebKit Review Bot
Comment 7 2012-08-09 17:28:48 PDT
Comment on attachment 157398 [details] Patch Rejecting attachment 157398 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: orationProperty(WebCore::CSSPropertyID, WTF::PassRefPtr<WebCore::CSSValue>, bool)': Source/WebCore/css/CSSParser.cpp:7921: error: 'class WTF::OwnPtr<WTF::Vector<WebCore::CSSProperty, 256ul> >' has no member named 'size' Source/WebCore/css/CSSParser.cpp:7922: error: no match for 'operator[]' in '((WebCore::CSSParser*)this)->WebCore::CSSParser::m_parsedProperties[i]' make: *** [out/Debug/obj.target/webcore_remaining/Source/WebCore/css/CSSParser.o] Error 1 make: *** Waiting for unfinished jobs.... Full output: http://queues.webkit.org/results/13471322
Shane Stephens
Comment 8 2012-08-09 19:42:11 PDT
Created attachment 157615 [details] Patch for landing
WebKit Review Bot
Comment 9 2012-08-09 22:14:28 PDT
Comment on attachment 157615 [details] Patch for landing Clearing flags on attachment: 157615 Committed r125252: <http://trac.webkit.org/changeset/125252>
WebKit Review Bot
Comment 10 2012-08-09 22:14:32 PDT
All reviewed patches have been landed. Closing bug.
Andreas Kling
Comment 11 2012-10-02 17:36:18 PDT
This patch added two heap allocations to the CSSParser constructor as "prep work" for CSS hierarchies (bug 79939) which hasn't progressed in over a month AFAICT. I don't think this is acceptable overhead for an experimental feature. Can we put this behind ENABLE(CSS_HIERARCHIES) somehow?
Tony Chang
Comment 12 2012-10-02 17:43:28 PDT
(In reply to comment #11) > This patch added two heap allocations to the CSSParser constructor as "prep work" for CSS hierarchies (bug 79939) which hasn't progressed in over a month AFAICT. > > I don't think this is acceptable overhead for an experimental feature. Can we put this behind ENABLE(CSS_HIERARCHIES) somehow? Shane is on paternity leave, which is why he's been AFK. If this is showing up on a profile or page cycler, I think it would be fine to roll out. Wouldn't putting this behind an ENABLE(CSS_HIERARCHIES) be worse? It touches a lot of lines of code.
Note You need to log in before you can comment on or make changes to this bug.