Manage RuleSet and RuleData classes through std::unique_ptr instead of OwnPtr
Created attachment 223010 [details] Patch
Attachment 223010 [details] did not pass style-queue: ERROR: Source/WebCore/css/RuleSet.h:131: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 223010 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223010&action=review > Source/WebCore/css/CSSDefaultStyleSheets.cpp:111 > + defaultStyle = std::make_unique<RuleSet>().release(); > + defaultPrintStyle = std::make_unique<RuleSet>().release(); I know that Anders likes this, but I think it’s pretty strange to write a plain old “new” this way.
Comment on attachment 223010 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223010&action=review >> Source/WebCore/css/CSSDefaultStyleSheets.cpp:111 >> + defaultPrintStyle = std::make_unique<RuleSet>().release(); > > I know that Anders likes this, but I think it’s pretty strange to write a plain old “new” this way. The idea behind std::make_unique in general is to hide the use of 'new'. std::make_unique<T>().release() doesn't look pretty or make sense, but I guess ideally the code should be organized in a way where this doesn't need to be used.
(In reply to comment #4) > (From update of attachment 223010 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=223010&action=review > > >> Source/WebCore/css/CSSDefaultStyleSheets.cpp:111 > >> + defaultPrintStyle = std::make_unique<RuleSet>().release(); > > > > I know that Anders likes this, but I think it’s pretty strange to write a plain old “new” this way. > > The idea behind std::make_unique in general is to hide the use of 'new'. std::make_unique<T>().release() doesn't look pretty or make sense, but I guess ideally the code should be organized in a way where this doesn't need to be used. That said, and while I do prefer std::make_unique<T>().release(), I'm willing to use `new` if the style guidelines are agreed to favor that option.
Comment on attachment 223010 [details] Patch Clearing flags on attachment: 223010 Committed r163378: <http://trac.webkit.org/changeset/163378>
All reviewed patches have been landed. Closing bug.