Summary: | IconLoadingClient API doesn't work asynchronously | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brady Eidson <beidson> | ||||
Component: | WebKit Misc. | Assignee: | Brady Eidson <beidson> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, commit-queue, sam | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Brady Eidson
2017-01-27 15:55:56 PST
Created attachment 299972 [details]
Patch
Attachment 299972 [details] did not pass style-queue:
ERROR: Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.h:58: Extra space before ( in function call [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/Cocoa/IconLoadingDelegate.mm:74: Extra space before ( in function call [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:6731: Extra space before ( in function call [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:874: Place brace on its own line for function definitions. [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:874: Extra space before ( in function call [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/APIIconLoadingClient.h:42: Place brace on its own line for function definitions. [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/APIIconLoadingClient.h:42: Extra space before ( in function call [whitespace/parens] [4]
Total errors found: 7 in 6 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Alex gave in-person r+ with a small change. https://trac.webkit.org/changeset/211310 I don't understand what the issue is here. In my testing, WTF::Function works fine with blocks. Can you give an example where it doesn't work? Comment on attachment 299972 [details]
Patch
It doesn't work with blocks that are copied or not called immediately.
(In reply to comment #6) > Comment on attachment 299972 [details] > Patch > > It doesn't work with blocks that are copied or not called immediately. Can you give me an example? I made some unit tests that all seem to work when copying a block, but perhaps I am missing something. e.g. this works: TEST(FunctionBlock, BlockCopyAsync) { WTF::initializeMainThread(); typedef void (^BlockType)(); __block bool value = false; BlockType block = ^{ value = true; }; Function<void()> function((BlockType)[block copy]); callOnMainThread(WTFMove(function)); TestWebKitAPI::Util::run(&value); ASSERT_TRUE(value); } |