RESOLVED FIXED 122698
Change callOnMainThread to take an std::function
https://bugs.webkit.org/show_bug.cgi?id=122698
Summary Change callOnMainThread to take an std::function
Anders Carlsson
Reported 2013-10-12 11:58:16 PDT
Change callOnMainThread to take an std::function
Attachments
Patch (2.78 KB, patch)
2013-10-12 12:01 PDT, Anders Carlsson
no flags
Patch (2.79 KB, patch)
2013-10-12 13:20 PDT, Anders Carlsson
darin: review+
buildbot: commit-queue-
Anders Carlsson
Comment 1 2013-10-12 12:01:01 PDT
WebKit Commit Bot
Comment 2 2013-10-12 12:02:04 PDT
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.
Build Bot
Comment 3 2013-10-12 12:41:40 PDT
Anders Carlsson
Comment 4 2013-10-12 13:20:18 PDT
WebKit Commit Bot
Comment 5 2013-10-12 13:22:24 PDT
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.
Build Bot
Comment 6 2013-10-12 14:59:39 PDT
Darin Adler
Comment 7 2013-10-12 16:25:37 PDT
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
Anders Carlsson
Comment 8 2013-10-13 09:07:01 PDT
(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.
Anders Carlsson
Comment 9 2013-10-13 09:11:46 PDT
Note You need to log in before you can comment on or make changes to this bug.