WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
128116
Manage RuleSet and RuleData classes through std::unique_ptr instead of OwnPtr
https://bugs.webkit.org/show_bug.cgi?id=128116
Summary
Manage RuleSet and RuleData classes through std::unique_ptr instead of OwnPtr
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
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Zan Dobersek
Comment 1
2014-02-03 12:44:20 PST
Created
attachment 223010
[details]
Patch
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.
Top of Page
Format For Printing
XML
Clone This Bug