iOS Safari will not load USDZ in QLPreview when opening as BLOB
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 19:09:39 +0000 (19:09 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 19:09:39 +0000 (19:09 +0000)
commit71ca0565ecf7062041f89b32aaaace7df4bdea16
treefeed0c7e0ad9b7055467afdfd54dd35a3242baaa
parente6b5a3a35db41cdf19c863304ec142c1b6112c98
iOS Safari will not load USDZ in QLPreview when opening as BLOB
https://bugs.webkit.org/show_bug.cgi?id=194766
<rdar://problem/42769186>

Reviewed by Wenson Hsieh.

A download from a Blob URL can happen effectively instantly, which means
that the loadHandler on the registerItemForTypeIdentifier method might not have
been called yet, and we haven't been told what the completionHandler is.
In this case, keep a record of the URL we finished with, and call the completionHandler
right away.

* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add a new private member variable: _downloadedURL.
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): Call the completionHandler
right away if we've finished.
(-[_WKPreviewControllerDataSource finish:]): Remember that we've finished by recording the URL.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm