[iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy...
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Mar 2017 23:50:55 +0000 (23:50 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Mar 2017 23:50:55 +0000 (23:50 +0000)
commitb527f1f2e9e6cd3a6c31117273bbcdcd5b3edcb0
tree063314682976c5593104f19ec3ef5dbebbdfd0af
parent5990792af4c32822a30a997b23c331aa561d27a2
[iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php
https://bugs.webkit.org/show_bug.cgi?id=170197
<rdar://problem/30314067>

Reviewed by Brady Eidson.

Source/WebCore:

If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from
QuickLook, which will call back into PreviewLoader::didFail(). We only care about network
failures in PreviewLoader, not conversion failures, so check if
m_finishedLoadingDataIntoConverter is set before continuing (like we do in
PreviewLoader::didFinishLoading()).

Fixes crash in http/tests/multipart/policy-ignore-crash.php.

* loader/ios/PreviewLoader.mm:
(WebCore::PreviewLoader::didFail):

LayoutTests:

* platform/ios/TestExpectations: Unskipped http/tests/multipart/policy-ignore-crash.php.
* platform/ios/http/tests/multipart/policy-ignore-crash-expected.txt: Added an iOS-specific result.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@214506 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/ios/http/tests/multipart/policy-ignore-crash-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/ios/PreviewLoader.mm