Bug 130534

Summary: Move cross-port Source/WebCore/page/ code to std::unique_ptr
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dino, dstockwell, esprehn+autocc, kangil.han, mkwst, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch for landing none

Description Zan Dobersek 2014-03-20 13:20:43 PDT
Move cross-port Source/WebCore/page/ code to std::unique_ptr
Comment 1 Zan Dobersek 2014-03-20 13:40:40 PDT
Created attachment 227327 [details]
Patch
Comment 2 WebKit Commit Bot 2014-03-20 13:43:09 PDT
Attachment 227327 [details] did not pass style-queue:


ERROR: Source/WebCore/page/Frame.cpp:165:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/Frame.cpp:166:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:770:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:771:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:777:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:778:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
Total errors found: 6 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Zan Dobersek 2014-03-25 13:43:12 PDT
Created attachment 227791 [details]
Patch
Comment 4 WebKit Commit Bot 2014-03-25 13:44:23 PDT
Attachment 227791 [details] did not pass style-queue:


ERROR: Source/WebCore/page/Frame.cpp:165:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/Frame.cpp:166:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:770:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:771:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:777:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:778:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
Total errors found: 6 in 23 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Brent Fulgham 2014-04-16 11:49:04 PDT
Comment on attachment 227791 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227791&action=review

This looks good, but unfortunately seemed to choke in the EWS system for Mac.  Could you rebaseline and upload again so we can confirm it's okay?

> Source/WebCore/page/ContentSecurityPolicy.cpp:919
> +    std::unique_ptr<CSPDirectiveList> directives(new CSPDirectiveList(policy, type));

Why not auto directives = std::make_unique<CSPDirectiveList>(policy, type)?
Comment 6 Zan Dobersek 2014-04-20 12:24:00 PDT
Created attachment 229773 [details]
Patch
Comment 7 WebKit Commit Bot 2014-04-20 12:26:28 PDT
Attachment 229773 [details] did not pass style-queue:


ERROR: Source/WebCore/page/Frame.cpp:165:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/Frame.cpp:166:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:769:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:770:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:776:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:777:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
Total errors found: 6 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Darin Adler 2014-04-20 20:46:53 PDT
Comment on attachment 229773 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=229773&action=review

/Volumes/Data/EWS/WebKit/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm:485:60: error: reference to type 'const JSC::Yarr::RegularExpression' could not bind to an lvalue of type 'JSC::Yarr::RegularExpression *'

r=me as long as you fix the Mac build

> Source/WebCore/page/DOMWindow.cpp:158
> +        // This object gets deleted when std::unique_ptr falls out of scope..
> +        std::unique_ptr<PostMessageTimer> timer(this);
> +        m_window->postMessageTimerFired(*timer);

Not sure this is better than just calling "delete this" at the end of the function.

> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:1087
> +    CSSPropertyAnimationWrapperMap();

Why not leave this private?
Comment 9 Zan Dobersek 2014-04-21 04:09:00 PDT
Created attachment 229797 [details]
Patch for landing

Should fix the Mac build.
Comment 10 Zan Dobersek 2014-04-21 04:10:38 PDT
Comment on attachment 229773 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=229773&action=review

>> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:1087
>> +    CSSPropertyAnimationWrapperMap();
> 
> Why not leave this private?

It was made accessible to the NeverDestroyed constructor, but I now declared NeverDestroyed<CSSPropertyAnimationWrapperMap> as a friend instead.
Comment 11 WebKit Commit Bot 2014-04-21 04:11:55 PDT
Attachment 229797 [details] did not pass style-queue:


ERROR: Source/WebCore/page/Frame.cpp:165:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/Frame.cpp:166:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:769:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:770:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:776:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
ERROR: Source/WebCore/page/animation/CSSPropertyAnimation.cpp:777:  Wrong number of spaces before statement. (expected: 44)  [whitespace/indent] [4]
Total errors found: 6 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Zan Dobersek 2014-04-21 10:12:12 PDT
Comment on attachment 229797 [details]
Patch for landing

Clearing flags on attachment: 229797

Committed r167594: <http://trac.webkit.org/changeset/167594>
Comment 13 Zan Dobersek 2014-04-21 10:12:27 PDT
All reviewed patches have been landed.  Closing bug.