[iOS] Crash during font loading when injected bundle cancels load
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Mar 2016 18:30:52 +0000 (18:30 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Mar 2016 18:30:52 +0000 (18:30 +0000)
commit891984d6442913c1ae786ff6753dc5f327f77aad
treeebf3d6eb39665e5a710aef088b44a3b9f4d0977a
parent95f8b4fc58337de756efe06f89ff92af8479365a
[iOS] Crash during font loading when injected bundle cancels load
https://bugs.webkit.org/show_bug.cgi?id=155001

Reviewed by Tim Horton.

Source/WebCore:

If a injected bundle cancels the load, the fontLoaded() callback will be
called twice. We can simply detect this condition.

Test: CancelLoading.CancelFontSubresource API test

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::fontLoaded):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/Ahem.ttf: Added.
* TestWebKitAPI/Tests/WebKit2/webfont.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/CancelFontSubresource.mm: Added.
(-[Myles webView:didFinishNavigation:]):
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/CancelFontSubresourcePlugIn.mm: Added.
(-[CancelFontSubresourcePlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[CancelFontSubresourcePlugIn webProcessPlugInBrowserContextController:frame:willSendRequestForResource:request:redirectResponse:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFaceSource.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/Ahem.ttf [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/webfont.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/CancelFontSubresource.mm [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/CancelFontSubresourcePlugIn.mm [new file with mode: 0644]