Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2018 19:54:21 +0000 (19:54 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2018 19:54:21 +0000 (19:54 +0000)
commit325149339ef2feb532e84a727745f6963e872451
treea7157b839f0b9bbee8ba7396aa0874567a1f029b
parente2db738e7cf1e9eb674299a2fd08c235ed60347b
Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called
https://bugs.webkit.org/show_bug.cgi?id=187007
<rdar://problem/41293989>

Reviewed by Brady Eidson.

Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called by
switching its type to WTF::CompletionHandler instead of WTF::Function. This also has the benefit
of destroying our captured objects when the completion handler gets called by the client on the
main thread instead of whatever thread the ObjC block gets released on.

* UIProcess/API/APIIconLoadingClient.h:
(API::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/API/glib/WebKitIconLoadingClient.cpp:
* UIProcess/API/mac/WKView.mm:
(-[WKView maybeInstallIconLoadingClient]):
* UIProcess/Cocoa/IconLoadingDelegate.h:
* UIProcess/Cocoa/IconLoadingDelegate.mm:
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/APIIconLoadingClient.h
Source/WebKit/UIProcess/API/glib/WebKitIconLoadingClient.cpp
Source/WebKit/UIProcess/API/mac/WKView.mm
Source/WebKit/UIProcess/Cocoa/IconLoadingDelegate.h
Source/WebKit/UIProcess/Cocoa/IconLoadingDelegate.mm