WebKit Bugzilla
Attachment 362248 Details for
Bug 194766
: iOS Safari will not load USDZ in QLPreview when opening as BLOB
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194766-20190218084036.patch (text/plain), 3.21 KB, created by
Dean Jackson
on 2019-02-17 13:40:38 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2019-02-17 13:40:38 PST
Size:
3.21 KB
patch
obsolete
>Subversion Revision: 241633 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6d5fb648374a61b868c52eb80f43826d91f7e8ed..5dba08feffab81f579b8b52064fffe6f4c12e518 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,23 @@ >+2019-02-17 Dean Jackson <dino@apple.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ 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 two new private member variables, >+ _hasFinished and _finishedURL. >+ (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): Call the completionHandler >+ right away if we've finished. >+ (-[_WKPreviewControllerDataSource finish:]): Remember that we've finished. >+ > 2019-02-15 Chris Dumez <cdumez@apple.com> > > [PSON] Disable WebContent process cache on devices with less than 3GB of RAM >diff --git a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >index 31f2871de430713acc0677e9ff306edb26f2da65..0a3dcb024e8205ae8f6d3b66bb291ae9656f320e 100644 >--- a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >@@ -41,6 +41,8 @@ > @interface _WKPreviewControllerDataSource : NSObject <QLPreviewControllerDataSource> { > RetainPtr<NSItemProvider> _itemProvider; > RetainPtr<QLItem> _item; >+ BOOL _hasFinished; >+ URL _finishedURL; > }; > > @property (strong) NSItemProviderCompletionHandler completionHandler; >@@ -87,10 +89,16 @@ > _item = adoptNS([PAL::allocQLItemInstance() initWithPreviewItemProvider:_itemProvider.get() contentType:contentType previewTitle:@"Preview" fileSize:@(0)]); > [_item setUseLoadingTimeout:NO]; > >+ _hasFinished = NO; > WeakObjCPtr<_WKPreviewControllerDataSource> weakSelf { self }; > [_itemProvider registerItemForTypeIdentifier:contentType loadHandler:[weakSelf = WTFMove(weakSelf)] (NSItemProviderCompletionHandler completionHandler, Class expectedValueClass, NSDictionary * options) { >- if (auto strongSelf = weakSelf.get()) >+ if (auto strongSelf = weakSelf.get()) { > [strongSelf setCompletionHandler:completionHandler]; >+ // If the download happened instantly, the call to finish might have come before this >+ // loadHandler. In that case, call the completionHandler here. >+ if (strongSelf->_hasFinished) >+ completionHandler((NSURL*)strongSelf->_finishedURL, nil); >+ } > }]; > return _item.get(); > } >@@ -103,6 +111,9 @@ > > - (void)finish:(URL)url > { >+ _hasFinished = YES; >+ _finishedURL = url; >+ > if (self.completionHandler) > self.completionHandler((NSURL*)url, nil); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
wenson_hsieh
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194766
: 362248