Change callOnMainThread to take an std::function
Created attachment 214061 [details] Patch
Attachment 214061 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/MainThread.cpp', u'Source/WTF/wtf/MainThread.h']" exit_code: 1 Source/WTF/wtf/MainThread.h:48: Extra space before ( in function call [whitespace/parens] [4] Source/WTF/wtf/MainThread.cpp:233: Extra space before ( in function call [whitespace/parens] [4] Source/WTF/wtf/MainThread.cpp:235: Place brace on its own line for function definitions. [whitespace/braces] [4] Source/WTF/wtf/MainThread.cpp:236: Extra space before ( in function call [whitespace/parens] [4] Source/WTF/wtf/MainThread.cpp:240: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 5 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 214061 [details] Patch Attachment 214061 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/3582033
Created attachment 214063 [details] Patch
Attachment 214063 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/MainThread.cpp', u'Source/WTF/wtf/MainThread.h']" exit_code: 1 Source/WTF/wtf/MainThread.h:48: Extra space before ( in function call [whitespace/parens] [4] Source/WTF/wtf/MainThread.cpp:233: Extra space before ( in function call [whitespace/parens] [4] Source/WTF/wtf/MainThread.cpp:235: Place brace on its own line for function definitions. [whitespace/braces] [4] Source/WTF/wtf/MainThread.cpp:236: Extra space before ( in function call [whitespace/parens] [4] Source/WTF/wtf/MainThread.cpp:240: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 5 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 214063 [details] Patch Attachment 214063 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/3788079
Comment on attachment 214063 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=214063&action=review >> Source/WTF/wtf/MainThread.cpp:240 >> + callOnMainThread(+callFunctionObject, std::make_unique<std::function<void ()>>(std::move(function)).release()); > > Extra space before ( in function call [whitespace/parens] [4] What does the "+" here mean? Whatever it means, it seems that Windows does not understand it: 1>..\wtf\MainThread.cpp(240): error C2675: unary '+' : 'WTF::`anonymous-namespace'::<lambda0>' does not define this operator or a conversion to a type acceptable to the predefined operator
(In reply to comment #7) > (From update of attachment 214063 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=214063&action=review > > >> Source/WTF/wtf/MainThread.cpp:240 > >> + callOnMainThread(+callFunctionObject, std::make_unique<std::function<void ()>>(std::move(function)).release()); > > > > Extra space before ( in function call [whitespace/parens] [4] > > What does the "+" here mean? Whatever it means, it seems that Windows does not understand it: > > 1>..\wtf\MainThread.cpp(240): error C2675: unary '+' : 'WTF::`anonymous-namespace'::<lambda0>' does not define this operator or a conversion to a type acceptable to the predefined operator It explictly converts the lambda to a function pointer. Looks like MSVC doesn't support converting lambdas to function pointers, so I'm going to have to use a regular function instead.
Committed r157374: <http://trac.webkit.org/changeset/157374>