WebKit Bugzilla
Attachment 348876 Details for
Bug 189288
: Post review Weinig fix-ups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189288-20180905101627.patch (text/plain), 8.43 KB, created by
Dean Jackson
on 2018-09-04 17:16:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2018-09-04 17:16:28 PDT
Size:
8.43 KB
patch
obsolete
>Subversion Revision: 235642 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c526766dd0af0f33bd0c01065d87d1e0a9374a06..a15c95a98ea1a3a0437e9178194aa127e12120c0 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-09-04 Dean Jackson <dino@apple.com> >+ >+ Post review Weinig fix-ups >+ https://bugs.webkit.org/show_bug.cgi?id=189288 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fix-ups from https://bugs.webkit.org/show_bug.cgi?id=189252 >+ >+ * platform/MIMETypeRegistry.cpp: >+ (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): >+ (WebCore::initializeSystemPreviewMIMETypes): Deleted. >+ * rendering/RenderThemeIOS.mm: >+ (WebCore::arKitBundle): >+ (WebCore::loadARKitPDFPage): >+ (WebCore::systemPreviewLogo): >+ > 2018-09-04 Youenn Fablet <youenn@apple.com> > > Disable WebRTC unified plan runtime flag by default >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b924630463a5ac681ca54c9742d75911ffc1bba0..a72d5f3f0cf3aedec861580e5f36c26f1c37c47c 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-09-04 Dean Jackson <dino@apple.com> >+ >+ Post review Weinig fix-ups >+ https://bugs.webkit.org/show_bug.cgi?id=189288 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fix-ups from https://bugs.webkit.org/show_bug.cgi?id=189252 >+ >+ * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: >+ (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): >+ (getUTIForMIMEType): Deleted. >+ * UIProcess/ios/WKSystemPreviewView.mm: >+ (getUTIForSystemPreviewMIMEType): >+ (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): >+ (getUTIForMIMEType): Deleted. >+ > 2018-09-04 Youenn Fablet <youenn@apple.com> > > Disable WebRTC unified plan runtime flag by default >diff --git a/Source/WebCore/platform/MIMETypeRegistry.cpp b/Source/WebCore/platform/MIMETypeRegistry.cpp >index 829bf0de31f2fdd98e609868cedb443ed3d73993..e6c33c5ee0f6ccdb20ab68706303d3772884eeb5 100644 >--- a/Source/WebCore/platform/MIMETypeRegistry.cpp >+++ b/Source/WebCore/platform/MIMETypeRegistry.cpp >@@ -705,26 +705,16 @@ const String& defaultMIMEType() > } > > #if USE(SYSTEM_PREVIEW) >-static void initializeSystemPreviewMIMETypes() >+const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSystemPreviewMIMETypes() > { >- const char* const types[] = { >+ static NeverDestroyed<HashSet<String, ASCIICaseInsensitiveHash>> systemPreviewMIMETypes = std::initializer_list<String> { > // The official type: https://www.iana.org/assignments/media-types/model/vnd.usdz+zip > "model/vnd.usdz+zip", > // Unofficial, but supported because we documented them. > "model/usd", > "model/vnd.pixar.usd" > }; >- >- systemPreviewMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>; >- for (auto& type : types) >- systemPreviewMIMETypes->add(type); >-} >- >-const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSystemPreviewMIMETypes() >-{ >- if (!systemPreviewMIMETypes) >- initializeSystemPreviewMIMETypes(); >- return *systemPreviewMIMETypes; >+ return systemPreviewMIMETypes; > } > > bool MIMETypeRegistry::isSystemPreviewMIMEType(const String& mimeType) >diff --git a/Source/WebCore/rendering/RenderThemeIOS.mm b/Source/WebCore/rendering/RenderThemeIOS.mm >index 27378821e66970fbbb49441395adaa534895b38a..11d230254fd2126e8ffaa6db52fd25ba063e8ed1 100644 >--- a/Source/WebCore/rendering/RenderThemeIOS.mm >+++ b/Source/WebCore/rendering/RenderThemeIOS.mm >@@ -1856,15 +1856,14 @@ String RenderThemeIOS::extraDefaultStyleSheet() > static NSBundle *arKitBundle() > { > static NSBundle *arKitBundle; >- static dispatch_once_t onceToken; >- dispatch_once(&onceToken, ^{ >+ if (!arKitBundle) { > #if PLATFORM(IOS_SIMULATOR) > dlopen("/System/Library/PrivateFrameworks/AssetViewer.framework/AssetViewer", RTLD_NOW); > arKitBundle = [NSBundle bundleForClass:NSClassFromString(@"ASVThumbnailView")]; > #else > arKitBundle = [NSBundle bundleWithURL:[NSURL fileURLWithPath:@"/System/Library/PrivateFrameworks/AssetViewer.framework"]]; > #endif >- }); >+ } > > return arKitBundle; > } >@@ -1884,18 +1883,16 @@ static RetainPtr<CGPDFPageRef> loadARKitPDFPage(NSString *imageName) > return nullptr; > > return CGPDFDocumentGetPage(document.get(), 1); >-}; >+} > > static CGPDFPageRef systemPreviewLogo() > { > static CGPDFPageRef logoPage; >- static dispatch_once_t onceToken; >- dispatch_once(&onceToken, ^{ >+ if (!logoPage) > logoPage = loadARKitPDFPage(@"ARKitBadge").leakRef(); >- }); > > return logoPage; >-}; >+} > > void RenderThemeIOS::paintSystemPreviewBadge(Image& image, const PaintInfo& paintInfo, const FloatRect& rect) > { >diff --git a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >index eb4af1df3feef0ed275d092eb8adbe3246a8b37d..a7dad4815261a98c6c11d3448f3db218131a62da 100644 >--- a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >@@ -42,18 +42,6 @@ SOFT_LINK_FRAMEWORK(QuickLook) > SOFT_LINK_CLASS(QuickLook, QLPreviewController); > SOFT_LINK_CLASS(QuickLook, QLItem); > >-// FIXME: At the moment we only have one supported UTI, but >-// if we start supporting more types, then we'll need a table. >-static String getUTIForMIMEType(const String& mimeType) >-{ >- static const NeverDestroyed<String> uti = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, CFSTR("usdz"), nil)).get(); >- >- if (!WebCore::MIMETypeRegistry::isSystemPreviewMIMEType(mimeType)) >- return emptyString(); >- >- return uti; >-} >- > @interface _WKPreviewControllerDataSource : NSObject <QLPreviewControllerDataSource> { > RetainPtr<NSItemProvider> _itemProvider; > RetainPtr<QLItem> _item; >@@ -95,8 +83,10 @@ static String getUTIForMIMEType(const String& mimeType) > > _itemProvider = adoptNS([[NSItemProvider alloc] init]); > // FIXME: We are launching the preview controller before getting a response from the resource, which >- // means we don't actually know the real MIME type yet. Assume it is one of those that we registered. >- NSString *contentType = getUTIForMIMEType(*WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes().begin()); >+ // means we don't actually know the real MIME type yet. >+ // FIXME: At the moment we only have one supported UTI, but if we start supporting more types, >+ // then we'll need a table. >+ static NSString *contentType = (__bridge NSString *) UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, CFSTR("usdz"), nil); > > _item = adoptNS([allocQLItemInstance() initWithPreviewItemProvider:_itemProvider.get() contentType:contentType previewTitle:@"Preview" fileSize:@(0)]); > [_item setUseLoadingTimeout:NO]; >diff --git a/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm b/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm >index b8a540544868bdb42d093f83b2e33085f00d27cf..7d6c81e31bbee655e8f7f5152cff7114bc844e98 100644 >--- a/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm >+++ b/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm >@@ -50,12 +50,12 @@ SOFT_LINK_CLASS(AssetViewer, ASVThumbnailView); > > // FIXME: At the moment we only have one supported UTI, but > // if we start supporting more types, then we'll need a table. >-static String getUTIForMIMEType(const String& mimeType) >+static NSString *getUTIForSystemPreviewMIMEType(const String& mimeType) > { >- static const NeverDestroyed<String> uti = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, CFSTR("usdz"), nil)).get(); >+ static NSString *uti = (__bridge NSString *) UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, CFSTR("usdz"), nil); > > if (!WebCore::MIMETypeRegistry::isSystemPreviewMIMEType(mimeType)) >- return emptyString(); >+ return nil; > > return uti; > } >@@ -103,8 +103,7 @@ static String getUTIForMIMEType(const String& mimeType) > _suggestedFilename = adoptNS([filename copy]); > _data = adoptNS([data copy]); > >- NSString *contentType; >- contentType = getUTIForMIMEType(_mimeType.get()); >+ NSString *contentType = getUTIForSystemPreviewMIMEType(_mimeType.get()); > > _item = adoptNS([allocQLItemInstance() initWithDataProvider:self contentType:contentType previewTitle:_suggestedFilename.get()]); > [_item setUseLoadingTimeout:NO];
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:
sam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189288
: 348876