Bug 127273

Summary: [GTK][WK2] Move the rest of GTK's WorkQueue implementation to std::function
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch andersca: review+

Description Zan Dobersek 2014-01-20 01:22:27 PST
[GTK][WK2] Move the rest of GTK's WorkQueue implementation to std::function
Comment 1 Zan Dobersek 2014-01-20 01:34:40 PST
Created attachment 221634 [details]
Patch
Comment 2 WebKit Commit Bot 2014-01-20 01:35:41 PST
Attachment 221634 [details] did not pass style-queue:


ERROR: Source/WebKit2/Platform/WorkQueue.h:66:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:72:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:73:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:110:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:162:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:170:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 6 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Anders Carlsson 2014-01-20 11:57:39 PST
Comment on attachment 221634 [details]
Patch

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

> Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:73
> +        : EventSource(std::forward<std::function<void ()>>(function), workQueue)

This should just use std::move.

> Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:170
> -    SocketEventSource* eventSource = new SocketEventSource(function, this, cancellable.get(), closeFunction);
> +    SocketEventSource* eventSource = new SocketEventSource(std::forward<std::function<void ()>>(function), this,
> +        cancellable.get(), std::forward<std::function<void ()>>(closeFunction));

This should use std::move instead of std::forward.
Comment 4 Zan Dobersek 2014-01-20 13:13:08 PST
Committed r162370: <http://trac.webkit.org/changeset/162370>