Bug 169530

Summary: Transition GenericCallback from std::function to WTF::Function
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit2Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, aestes, cgarcia, clopez, commit-queue, ossy, zan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
dino: review+
Patch for landing none

Description Brady Eidson 2017-03-12 15:46:01 PDT
Transition GenericCallback from std::function to WTF::Function
Comment 1 Brady Eidson 2017-03-12 16:26:22 PDT
Created attachment 304207 [details]
Patch
Comment 2 WebKit Commit Bot 2017-03-12 16:28:00 PDT
Attachment 304207 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp:97:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp:179:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebProcessPool.cpp:1230:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:2977:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:2988:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:2999:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:3010:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/GenericCallback.h:202:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.h:104:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.h:105:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.h:106:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:803:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:804:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:807:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:809:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebCookieManagerProxy.h:68:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebCookieManagerProxy.h:76:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebProcessPool.h:277:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.cpp:205:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.cpp:215:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.cpp:225:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 21 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Dean Jackson 2017-03-12 17:42:16 PDT
Comment on attachment 304207 [details]
Patch

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

> Source/WebKit2/UIProcess/GenericCallback.h:110
> +        if (m_callback == std::nullopt)

m_callback is an optional - why not just !m_callback?

> Source/WebKit2/UIProcess/GenericCallback.h:204
> +        auto callback = GenericCallbackType<sizeof...(T), T...>::type::create(WTFMove(function), activityToken);

I have zero idea what this means, so r=me!!!!
Comment 4 Brady Eidson 2017-03-12 17:53:18 PDT
(In reply to comment #3)
> Comment on attachment 304207 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=304207&action=review
> 
> > Source/WebKit2/UIProcess/GenericCallback.h:110
> > +        if (m_callback == std::nullopt)
> 
> m_callback is an optional - why not just !m_callback?

At some point in the lifecycle of our WTF::Optional we didn't support the bool() operator and required comparison to nullopt.

Flash forward to std::optional where I'd already established the habit but it's now possible!  \o/

>
Comment 5 Brady Eidson 2017-03-12 17:56:39 PDT
Created attachment 304212 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2017-03-12 17:58:02 PDT
Attachment 304212 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp:97:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp:179:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebProcessPool.cpp:1230:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:2977:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:2988:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:2999:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:3010:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/GenericCallback.h:202:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.h:104:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.h:105:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.h:106:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:803:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:804:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:807:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:809:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebCookieManagerProxy.h:68:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebCookieManagerProxy.h:76:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebProcessPool.h:277:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.cpp:205:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.cpp:215:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebFrameProxy.cpp:225:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 21 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 WebKit Commit Bot 2017-03-12 18:37:39 PDT
Comment on attachment 304212 [details]
Patch for landing

Clearing flags on attachment: 304212

Committed r213777: <http://trac.webkit.org/changeset/213777>
Comment 8 Csaba Osztrogonác 2017-03-12 23:38:05 PDT
(In reply to comment #7)
> Comment on attachment 304212 [details]
> Patch for landing
> 
> Clearing flags on attachment: 304212
> 
> Committed r213777: <http://trac.webkit.org/changeset/213777>

It broke the GRK build, as the EWS noticed it, see https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release%20%28Build%29/builds/78168 for details.
Comment 9 Csaba Osztrogonác 2017-03-12 23:38:46 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > Comment on attachment 304212 [details]
> > Patch for landing
> > 
> > Clearing flags on attachment: 304212
> > 
> > Committed r213777: <http://trac.webkit.org/changeset/213777>
> 
> It broke the GRK build, as the EWS noticed it, see
> https://build.webkit.org/builders/GTK%20Linux%2064-
> bit%20Release%20%28Build%29/builds/78168 for details.

GRK -> GTK
Comment 10 Zan Dobersek 2017-03-13 00:43:26 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > Comment on attachment 304212 [details]
> > Patch for landing
> > 
> > Clearing flags on attachment: 304212
> > 
> > Committed r213777: <http://trac.webkit.org/changeset/213777>
> 
> It broke the GRK build, as the EWS noticed it, see
> https://build.webkit.org/builders/GTK%20Linux%2064-
> bit%20Release%20%28Build%29/builds/78168 for details.

Fixed in r213784.
https://trac.webkit.org/r213784