Bug 128116

Summary: Manage RuleSet and RuleData classes through std::unique_ptr instead of OwnPtr
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, gyuyoung.kim, macpherson, menard
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 128007    
Attachments:
Description Flags
Patch none

Zan Dobersek
Reported 2014-02-03 12:43:08 PST
Manage RuleSet and RuleData classes through std::unique_ptr instead of OwnPtr
Attachments
Patch (10.53 KB, patch)
2014-02-03 12:44 PST, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2014-02-03 12:44:20 PST
WebKit Commit Bot
Comment 2 2014-02-03 12:47:03 PST
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.
Darin Adler
Comment 3 2014-02-03 14:57:07 PST
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.
Zan Dobersek
Comment 4 2014-02-04 05:20:57 PST
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.
Zan Dobersek
Comment 5 2014-02-04 07:50:35 PST
(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.
Zan Dobersek
Comment 6 2014-02-04 07:52:33 PST
Comment on attachment 223010 [details] Patch Clearing flags on attachment: 223010 Committed r163378: <http://trac.webkit.org/changeset/163378>
Zan Dobersek
Comment 7 2014-02-04 07:52:39 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.