Title: [220722] trunk
Revision
220722
Author
aes...@apple.com
Date
2017-08-14 16:21:03 -0700 (Mon, 14 Aug 2017)

Log Message

REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type
https://bugs.webkit.org/show_bug.cgi?id=175548
<rdar://problem/33866206>

Reviewed by Brady Eidson.

Source/WebCore:

New API test: QuickLook.ShouldCreateForMIMEType

* WebCore.xcodeproj/project.pbxproj:
* loader/ios/PreviewLoader.h:
* loader/ios/PreviewLoader.mm:
(WebCore::PreviewLoader::shouldCreateForMIMEType): Check if mimeType is a null String before
calling HashSet::contains().

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp: Added.
(TestWebKitAPI::TEST): Added an API test for PreviewLoader::shouldCreateForMIMEType().

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (220721 => 220722)


--- trunk/Source/WebCore/ChangeLog	2017-08-14 23:04:58 UTC (rev 220721)
+++ trunk/Source/WebCore/ChangeLog	2017-08-14 23:21:03 UTC (rev 220722)
@@ -1,5 +1,21 @@
 2017-08-14  Andy Estes  <aes...@apple.com>
 
+        REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type
+        https://bugs.webkit.org/show_bug.cgi?id=175548
+        <rdar://problem/33866206>
+
+        Reviewed by Brady Eidson.
+
+        New API test: QuickLook.ShouldCreateForMIMEType
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/ios/PreviewLoader.h:
+        * loader/ios/PreviewLoader.mm:
+        (WebCore::PreviewLoader::shouldCreateForMIMEType): Check if mimeType is a null String before
+        calling HashSet::contains().
+
+2017-08-14  Andy Estes  <aes...@apple.com>
+
         [Apple Pay] Add support for phonetic contact names
         https://bugs.webkit.org/show_bug.cgi?id=175537
         <rdar://problem/32002644>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (220721 => 220722)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-08-14 23:04:58 UTC (rev 220721)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-08-14 23:21:03 UTC (rev 220722)
@@ -4342,7 +4342,7 @@
 		A17D275E1EAC579800BF01E7 /* MediaSelectionOption.h in Headers */ = {isa = PBXBuildFile; fileRef = A17D275D1EAC579800BF01E7 /* MediaSelectionOption.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A182D5B71BE722670087A7CC /* SettingsCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A182D5B61BE722620087A7CC /* SettingsCocoa.mm */; };
 		A185B4291E8211A100DC9118 /* PreviewLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = A185B4271E8211A100DC9118 /* PreviewLoader.mm */; };
-		A185B42A1E8211A100DC9118 /* PreviewLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A185B4281E8211A100DC9118 /* PreviewLoader.h */; };
+		A185B42A1E8211A100DC9118 /* PreviewLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A185B4281E8211A100DC9118 /* PreviewLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A18890AE1AA13F250026C301 /* ParentalControlsContentFilter.mm in Sources */ = {isa = PBXBuildFile; fileRef = A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */; };
 		A18890AF1AA13F250026C301 /* ParentalControlsContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */; };
 		A18F7A361ECA73640059E1E1 /* RuntimeApplicationChecks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A18F7A351ECA73640059E1E1 /* RuntimeApplicationChecks.cpp */; };
@@ -26557,7 +26557,6 @@
 				29ACB212143E7128006BCA5F /* AccessibilityMockObject.h in Headers */,
 				29A812360FBB9C1D00510293 /* AccessibilityObject.h in Headers */,
 				A409C985116D0DDD007197BD /* AccessibilityProgressIndicator.h in Headers */,
-				51F175641F3EBC8300C74950 /* ServiceWorkerJobClient.h in Headers */,
 				29A812390FBB9C1D00510293 /* AccessibilityRenderObject.h in Headers */,
 				93C4F6EB1108F9A50099D0DB /* AccessibilityScrollbar.h in Headers */,
 				29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */,
@@ -26844,12 +26843,10 @@
 				BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
 				43EDD67F1B485DBF00640E75 /* CombinedFiltersAlphabet.h in Headers */,
 				26E944D91AC4B2DD007B85B5 /* CombinedURLFilters.h in Headers */,
-				51F175691F3EBC8300C74950 /* ServiceWorkerRegistrationOptions.h in Headers */,
 				A584FE351864D5AF00843B10 /* CommandLineAPIHost.h in Headers */,
 				A584FE2C1863870F00843B10 /* CommandLineAPIModule.h in Headers */,
 				A584FE2618637DAB00843B10 /* CommandLineAPIModuleSource.h in Headers */,
 				6550B6A2099DF0270090D781 /* Comment.h in Headers */,
-				511CA67E1F3905A60019E074 /* ServiceWorkerJob.h in Headers */,
 				57E664FC1E73703300765536 /* CommonCryptoDERUtilities.h in Headers */,
 				E1FE137518402A6700892F13 /* CommonCryptoUtilities.h in Headers */,
 				0F60F32B1DFBB10700416D6C /* CommonVM.h in Headers */,
@@ -27187,7 +27184,6 @@
 				8372DB311A6780A800C697C5 /* DiagnosticLoggingResultType.h in Headers */,
 				CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */,
 				CECADFC9153778FF00E37068 /* DictationCommand.h in Headers */,
-				51F175631F3EBC8300C74950 /* ServiceWorkerJob.h in Headers */,
 				D0BD4F5D1408850F006839B6 /* DictationCommandIOS.h in Headers */,
 				937FF3D51A1012D6008EBA31 /* DictionaryLookup.h in Headers */,
 				2D5646B01B8F8493003C4994 /* DictionaryPopupInfo.h in Headers */,
@@ -27241,7 +27237,6 @@
 				A9C6E4E80D745E18006442E9 /* DOMMimeTypeArray.h in Headers */,
 				52B6C9C315E3F4DF00690B05 /* DOMNamedFlowCollection.h in Headers */,
 				1ACE53E80A8D18E70022947D /* DOMParser.h in Headers */,
-				51F1755F1F3EBC8300C74950 /* ServiceWorkerContainer.h in Headers */,
 				7A54881714E432A1006AE05A /* DOMPatchSupport.h in Headers */,
 				FB91392416AE4C17001FE682 /* DOMPath.h in Headers */,
 				A9C6E4EC0D745E2B006442E9 /* DOMPlugin.h in Headers */,
@@ -27574,7 +27569,6 @@
 				93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */,
 				977B3867122883E900B81FF8 /* HTMLDocumentParser.h in Headers */,
 				93F198E608245E59001E9ABC /* HTMLElement.h in Headers */,
-				51BEB6391F3B94B0005029B9 /* ServiceWorkerRegistrationOptions.h in Headers */,
 				A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */,
 				977B37241228721700B81FF8 /* HTMLElementStack.h in Headers */,
 				B562DB6017D3CD630010AF96 /* HTMLElementTypeHelpers.h in Headers */,
@@ -28321,7 +28315,6 @@
 				5E2C43741BCF0D750001E2BC /* JSRTCRtpSender.h in Headers */,
 				5E2C43721BCF0D750001E2BD /* JSRTCRtpTransceiver.h in Headers */,
 				316DCB221E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.h in Headers */,
-				51F1756C1F3EBC8300C74950 /* ServiceWorkerUpdateViaCache.h in Headers */,
 				07969DBC17D14151007FF842 /* JSRTCSessionDescription.h in Headers */,
 				316DCB501E7910A6001B5F87 /* JSRTCSignalingState.h in Headers */,
 				07969DC217D14151007FF842 /* JSRTCStatsReport.h in Headers */,
@@ -28407,7 +28400,6 @@
 				B2FA3D810AB75A6F000E5AC4 /* JSSVGFEFuncRElement.h in Headers */,
 				B2FA3D830AB75A6F000E5AC4 /* JSSVGFEGaussianBlurElement.h in Headers */,
 				B2FA3D850AB75A6F000E5AC4 /* JSSVGFEImageElement.h in Headers */,
-				51F175681F3EBC8300C74950 /* ServiceWorkerRegistration.h in Headers */,
 				B2FA3D870AB75A6F000E5AC4 /* JSSVGFEMergeElement.h in Headers */,
 				B2FA3D890AB75A6F000E5AC4 /* JSSVGFEMergeNodeElement.h in Headers */,
 				84224184107E77F400766A87 /* JSSVGFEMorphologyElement.h in Headers */,
@@ -28680,7 +28672,6 @@
 				A516E8B7136E04DB0076C3C0 /* LocalizedDateCache.h in Headers */,
 				935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */,
 				BCE1C41B0D982980003B02F2 /* Location.h in Headers */,
-				51F175611F3EBC8300C74950 /* ServiceWorkerGlobalScope.h in Headers */,
 				A8239E0109B3CF8A00B60641 /* Logging.h in Headers */,
 				9BA273F4172206BB0097CE47 /* LogicalSelectionOffsetCaches.h in Headers */,
 				0FDCD7F31D47E655009F08BC /* LogInitialization.h in Headers */,
@@ -28836,7 +28827,6 @@
 				07EE76EC1BE96DB000F89133 /* MockRealtimeVideoSource.h in Headers */,
 				07EE76EF1BEA619800F89133 /* MockRealtimeVideoSourceMac.h in Headers */,
 				CDF2B0171820540700F2B424 /* MockSourceBufferPrivate.h in Headers */,
-				511CA6801F39331F0019E074 /* ServiceWorkerJobClient.h in Headers */,
 				CDF2B0191820540700F2B424 /* MockTracks.h in Headers */,
 				C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */,
 				709A01FE1E3D0BDD006B0D4C /* ModuleFetchFailureKind.h in Headers */,
@@ -29049,7 +29039,6 @@
 				935C476809AC4D4300A6AAB4 /* PlatformKeyboardEvent.h in Headers */,
 				0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */,
 				F544F78915CFB2A800AF33A8 /* PlatformLocale.h in Headers */,
-				51F1755D1F3EBC8300C74950 /* ServiceWorker.h in Headers */,
 				CEEFCD7C19DB33DC003876D7 /* PlatformMediaResourceLoader.h in Headers */,
 				070E09191875EEFC003A1D3C /* PlatformMediaSession.h in Headers */,
 				07F944161864D046005D31CB /* PlatformMediaSessionManager.h in Headers */,
@@ -29150,7 +29139,6 @@
 				07C1C0E51BFB60ED00BD2256 /* RealtimeMediaSourceSupportedConstraints.h in Headers */,
 				41103AAC1E39791000769F03 /* RealtimeOutgoingAudioSource.h in Headers */,
 				BC4368E80C226E32005EFB5F /* Rect.h in Headers */,
-				511CA6841F3A3CD90019E074 /* ServiceWorkerRegistrationParameters.h in Headers */,
 				FD45A958175D414C00C21EC8 /* RectangleShape.h in Headers */,
 				9831AE4A154225C900FE2644 /* ReferrerPolicy.h in Headers */,
 				BCAB418213E356E800D8AAF3 /* Region.h in Headers */,
@@ -29425,7 +29413,6 @@
 				CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */,
 				0F1774801378B772009DA76A /* ScrollAnimatorIOS.h in Headers */,
 				BCAE1FA712939DB7004CB026 /* ScrollAnimatorMac.h in Headers */,
-				51F1756B1F3EBC8300C74950 /* ServiceWorkerRegistrationParameters.h in Headers */,
 				5CB37FFF1C62D2A100F20188 /* ScrollAnimatorMock.h in Headers */,
 				93F199B808245E59001E9ABC /* Scrollbar.h in Headers */,
 				BC8B854B0E7C7F5600AB6984 /* ScrollbarTheme.h in Headers */,
@@ -29493,10 +29480,23 @@
 				A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */,
 				516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */,
 				2D93AEE319DF5641002A86C3 /* ServicesOverlayController.h in Headers */,
+				51F1755D1F3EBC8300C74950 /* ServiceWorker.h in Headers */,
 				5182C23F1F313A090059BA7C /* ServiceWorker.h in Headers */,
+				51F1755F1F3EBC8300C74950 /* ServiceWorkerContainer.h in Headers */,
 				5182C2411F313A090059BA7C /* ServiceWorkerContainer.h in Headers */,
+				51F175611F3EBC8300C74950 /* ServiceWorkerGlobalScope.h in Headers */,
 				5182C2431F313A090059BA7C /* ServiceWorkerGlobalScope.h in Headers */,
+				51F175631F3EBC8300C74950 /* ServiceWorkerJob.h in Headers */,
+				511CA67E1F3905A60019E074 /* ServiceWorkerJob.h in Headers */,
+				51F175641F3EBC8300C74950 /* ServiceWorkerJobClient.h in Headers */,
+				511CA6801F39331F0019E074 /* ServiceWorkerJobClient.h in Headers */,
+				511CA67A1F3904B10019E074 /* ServiceWorkerProvider.h in Headers */,
+				51F175661F3EBC8300C74950 /* ServiceWorkerProvider.h in Headers */,
+				51F175681F3EBC8300C74950 /* ServiceWorkerRegistration.h in Headers */,
 				5182C2451F313A090059BA7C /* ServiceWorkerRegistration.h in Headers */,
+				51F175691F3EBC8300C74950 /* ServiceWorkerRegistrationOptions.h in Headers */,
+				51F1756B1F3EBC8300C74950 /* ServiceWorkerRegistrationParameters.h in Headers */,
+				51F1756C1F3EBC8300C74950 /* ServiceWorkerUpdateViaCache.h in Headers */,
 				51F174FF1F35899700C74950 /* ServiceWorkerUpdateViaCache.h in Headers */,
 				756B2CE118B7101600FECFAA /* SessionID.h in Headers */,
 				93309E10099E64920056E581 /* SetNodeAttributeCommand.h in Headers */,
@@ -29830,7 +29830,6 @@
 				83C1D42F178D5AB500141E68 /* SVGPathSegLinetoAbs.h in Headers */,
 				B2227A780D00BF220071B782 /* SVGPathSegLinetoHorizontal.h in Headers */,
 				83C1D430178D5AB500141E68 /* SVGPathSegLinetoHorizontalAbs.h in Headers */,
-				511CA67A1F3904B10019E074 /* ServiceWorkerProvider.h in Headers */,
 				83C1D431178D5AB500141E68 /* SVGPathSegLinetoHorizontalRel.h in Headers */,
 				83C1D432178D5AB500141E68 /* SVGPathSegLinetoRel.h in Headers */,
 				B2227A7D0D00BF220071B782 /* SVGPathSegLinetoVertical.h in Headers */,
@@ -30011,7 +30010,6 @@
 				2D7ED0AB1BAE99170043B3E5 /* TimerEventBasedMock.h in Headers */,
 				49E912AE0EFAC906009D0CAF /* TimingFunction.h in Headers */,
 				0F54DD081881D5F5003EEDBB /* Touch.h in Headers */,
-				51F175661F3EBC8300C74950 /* ServiceWorkerProvider.h in Headers */,
 				0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */,
 				0F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */,
 				070334D71459FFD5008D8D45 /* TrackBase.h in Headers */,
@@ -31221,7 +31219,6 @@
 				CECADFC6153778FF00E37068 /* DictationAlternative.cpp in Sources */,
 				CECADFC8153778FF00E37068 /* DictationCommand.cpp in Sources */,
 				D0BD4F5C1408850F006839B6 /* DictationCommandIOS.cpp in Sources */,
-				51F1756A1F3EBC8300C74950 /* ServiceWorkerRegistrationParameters.cpp in Sources */,
 				937FF3D71A10131B008EBA31 /* DictionaryLookup.mm in Sources */,
 				FDAF19981513D131008DB0C3 /* DirectConvolver.cpp in Sources */,
 				7E4DE10D198B10B60051CB02 /* DiskCacheMonitorCocoa.mm in Sources */,
@@ -31551,7 +31548,6 @@
 				51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */,
 				5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */,
 				4969B0F213D0B33F00DF3521 /* HitTestingTransformState.cpp in Sources */,
-				511CA6831F3A3CD90019E074 /* ServiceWorkerRegistrationParameters.cpp in Sources */,
 				2D8287F616E4A0380086BD00 /* HitTestLocation.cpp in Sources */,
 				9307F1D70AF2D59000DBA31A /* HitTestResult.cpp in Sources */,
 				FD31609812B026F700C1A359 /* HRTFDatabase.cpp in Sources */,
@@ -31734,7 +31730,6 @@
 				A77979190D6B9D0C003851B9 /* ImageData.cpp in Sources */,
 				555B87EC1CAAF0AB00349425 /* ImageDecoderCG.cpp in Sources */,
 				97205AB51239291000B17380 /* ImageDocument.cpp in Sources */,
-				51F1755C1F3EBC8300C74950 /* ServiceWorker.cpp in Sources */,
 				5576A5641D88A70800CCC04C /* ImageFrame.cpp in Sources */,
 				5597F8261D91C3130066BC21 /* ImageFrameCache.cpp in Sources */,
 				F55B3DC11251F12D003EF269 /* ImageInputType.cpp in Sources */,
@@ -32109,7 +32104,6 @@
 				1AE2AA2E0A1CDAB400B42B25 /* JSHTMLHeadingElement.cpp in Sources */,
 				1AE2AA300A1CDAB400B42B25 /* JSHTMLHRElement.cpp in Sources */,
 				1A85B18F0A1B18A200D8C87C /* JSHTMLHtmlElement.cpp in Sources */,
-				51F175621F3EBC8300C74950 /* ServiceWorkerJob.cpp in Sources */,
 				BC4918C80BFEA050009D6316 /* JSHTMLIFrameElement.cpp in Sources */,
 				1AE2AA970A1CDD2D00B42B25 /* JSHTMLImageElement.cpp in Sources */,
 				A80E7E980A1A83E3007FB8C5 /* JSHTMLInputElement.cpp in Sources */,
@@ -32625,7 +32619,6 @@
 				E1C8BE5D0E8BD15A0064CB7D /* JSWorker.cpp in Sources */,
 				E182568F0EF2B02D00933242 /* JSWorkerGlobalScope.cpp in Sources */,
 				E1C36D340EB0A094007410BC /* JSWorkerGlobalScopeBase.cpp in Sources */,
-				511CA6791F3904B10019E074 /* ServiceWorkerProvider.cpp in Sources */,
 				E18258AC0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp in Sources */,
 				E1C362F00EAF2AA9007410BC /* JSWorkerLocation.cpp in Sources */,
 				E1271A590EEECDE400F61213 /* JSWorkerNavigator.cpp in Sources */,
@@ -33108,7 +33101,6 @@
 				0FD308D5117D168500A791F7 /* RenderIFrame.cpp in Sources */,
 				BCEA4875097D93020094C9E4 /* RenderImage.cpp in Sources */,
 				08F2F0091213E61700DCEC48 /* RenderImageResource.cpp in Sources */,
-				51F175671F3EBC8300C74950 /* ServiceWorkerRegistration.cpp in Sources */,
 				08641D4712142F7D008DE9F6 /* RenderImageResourceStyleImage.cpp in Sources */,
 				BCEA4877097D93020094C9E4 /* RenderInline.cpp in Sources */,
 				BCEA4879097D93020094C9E4 /* RenderLayer.cpp in Sources */,
@@ -33153,7 +33145,6 @@
 				BCE93F471517C6D5008CCF74 /* RenderRegionSet.cpp in Sources */,
 				A871DFE20A15376B00B12A68 /* RenderReplaced.cpp in Sources */,
 				BCA846D60DC67A350026C309 /* RenderReplica.cpp in Sources */,
-				51F1755E1F3EBC8300C74950 /* ServiceWorkerContainer.cpp in Sources */,
 				1479FAED109AE37500DED655 /* RenderRuby.cpp in Sources */,
 				1479FAEF109AE37500DED655 /* RenderRubyBase.cpp in Sources */,
 				1479FAF1109AE37500DED655 /* RenderRubyRun.cpp in Sources */,
@@ -33174,7 +33165,6 @@
 				A8DF4AE80980C42C0052981B /* RenderTableCol.cpp in Sources */,
 				A8DF4AF00980C42C0052981B /* RenderTableRow.cpp in Sources */,
 				A8DF4AED0980C42C0052981B /* RenderTableSection.cpp in Sources */,
-				511CA67D1F3905A60019E074 /* ServiceWorkerJob.cpp in Sources */,
 				BCEA488B097D93020094C9E4 /* RenderText.cpp in Sources */,
 				AB67D1A8097F3AE300F9392E /* RenderTextControl.cpp in Sources */,
 				083DAEA60F01A7FB00342754 /* RenderTextControlMultiLine.cpp in Sources */,
@@ -33357,10 +33347,20 @@
 				A75E497710752ACB00C9B896 /* SerializedScriptValue.cpp in Sources */,
 				516F7F6E1C31E39C00F111DC /* ServerOpenDBRequest.cpp in Sources */,
 				2D93AEE419DF5641002A86C3 /* ServicesOverlayController.mm in Sources */,
+				51F1755C1F3EBC8300C74950 /* ServiceWorker.cpp in Sources */,
 				5182C23E1F313A090059BA7C /* ServiceWorker.cpp in Sources */,
+				51F1755E1F3EBC8300C74950 /* ServiceWorkerContainer.cpp in Sources */,
 				5182C2401F313A090059BA7C /* ServiceWorkerContainer.cpp in Sources */,
 				5182C2421F313A090059BA7C /* ServiceWorkerGlobalScope.cpp in Sources */,
+				51F175601F3EBC8300C74950 /* ServiceWorkerGlobalScope.cpp in Sources */,
+				51F175621F3EBC8300C74950 /* ServiceWorkerJob.cpp in Sources */,
+				511CA67D1F3905A60019E074 /* ServiceWorkerJob.cpp in Sources */,
+				511CA6791F3904B10019E074 /* ServiceWorkerProvider.cpp in Sources */,
+				51F175651F3EBC8300C74950 /* ServiceWorkerProvider.cpp in Sources */,
+				51F175671F3EBC8300C74950 /* ServiceWorkerRegistration.cpp in Sources */,
 				5182C2441F313A090059BA7C /* ServiceWorkerRegistration.cpp in Sources */,
+				51F1756A1F3EBC8300C74950 /* ServiceWorkerRegistrationParameters.cpp in Sources */,
+				511CA6831F3A3CD90019E074 /* ServiceWorkerRegistrationParameters.cpp in Sources */,
 				511F7D441EB1C39100E47B83 /* SessionID.cpp in Sources */,
 				93309E0F099E64920056E581 /* SetNodeAttributeCommand.cpp in Sources */,
 				B8DBDB4B130B0F8A00F5CDB1 /* SetSelectionCommand.cpp in Sources */,
@@ -33638,7 +33638,6 @@
 				BC22747A0E8366E200E7F975 /* SVGRenderStyleDefs.cpp in Sources */,
 				B2227AA20D00BF220071B782 /* SVGScriptElement.cpp in Sources */,
 				B2227AA50D00BF220071B782 /* SVGSetElement.cpp in Sources */,
-				51F175601F3EBC8300C74950 /* ServiceWorkerGlobalScope.cpp in Sources */,
 				E4AFD00F0DAF335500F5F55C /* SVGSMILElement.cpp in Sources */,
 				B2227AA80D00BF220071B782 /* SVGStopElement.cpp in Sources */,
 				7C39C3761DDBB90D00FEFB29 /* SVGStringListValues.cpp in Sources */,
@@ -33740,7 +33739,6 @@
 				7AA3A699194A64E7001CBD24 /* TileController.cpp in Sources */,
 				1F72BF0A187FD4490009BCB3 /* TileControllerMemoryHandlerIOS.cpp in Sources */,
 				7AA3A6A3194B5C22001CBD24 /* TileCoverageMap.cpp in Sources */,
-				51F175651F3EBC8300C74950 /* ServiceWorkerProvider.cpp in Sources */,
 				7AA3A69B194A64E7001CBD24 /* TileGrid.cpp in Sources */,
 				498770F21242C535002226BA /* TilingData.cpp in Sources */,
 				F55B3DDB1251F12D003EF269 /* TimeInputType.cpp in Sources */,

Modified: trunk/Source/WebCore/loader/ios/PreviewLoader.h (220721 => 220722)


--- trunk/Source/WebCore/loader/ios/PreviewLoader.h	2017-08-14 23:04:58 UTC (rev 220721)
+++ trunk/Source/WebCore/loader/ios/PreviewLoader.h	2017-08-14 23:21:03 UTC (rev 220722)
@@ -41,7 +41,7 @@
 class PreviewLoader {
     WTF_MAKE_NONCOPYABLE(PreviewLoader);
 public:
-    static bool shouldCreateForMIMEType(const String&);
+    WEBCORE_EXPORT static bool shouldCreateForMIMEType(const String&);
     static std::unique_ptr<PreviewLoader> create(ResourceLoader&, const ResourceResponse&);
     ~PreviewLoader();
 

Modified: trunk/Source/WebCore/loader/ios/PreviewLoader.mm (220721 => 220722)


--- trunk/Source/WebCore/loader/ios/PreviewLoader.mm	2017-08-14 23:04:58 UTC (rev 220721)
+++ trunk/Source/WebCore/loader/ios/PreviewLoader.mm	2017-08-14 23:21:03 UTC (rev 220722)
@@ -210,6 +210,9 @@
             supportedMIMETypes.get().add(mimeType);
     });
 
+    if (mimeType.isNull())
+        return false;
+
     return supportedMIMETypes.get().contains(mimeType);
 }
 

Modified: trunk/Tools/ChangeLog (220721 => 220722)


--- trunk/Tools/ChangeLog	2017-08-14 23:04:58 UTC (rev 220721)
+++ trunk/Tools/ChangeLog	2017-08-14 23:21:03 UTC (rev 220722)
@@ -1,3 +1,15 @@
+2017-08-14  Andy Estes  <aes...@apple.com>
+
+        REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type
+        https://bugs.webkit.org/show_bug.cgi?id=175548
+        <rdar://problem/33866206>
+
+        Reviewed by Brady Eidson.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp: Added.
+        (TestWebKitAPI::TEST): Added an API test for PreviewLoader::shouldCreateForMIMEType().
+
 2017-08-14  Youenn Fablet  <you...@apple.com>
 
         WPT server should be able to do logging even if its output folder is not created at launch time

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (220721 => 220722)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2017-08-14 23:04:58 UTC (rev 220721)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2017-08-14 23:21:03 UTC (rev 220722)
@@ -558,6 +558,7 @@
 		A180C0FA1EE67DF000468F47 /* RunOpenPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = A180C0F91EE67DF000468F47 /* RunOpenPanel.mm */; };
 		A1C4FB731BACD1CA003742D0 /* pages.pages in Copy Resources */ = {isa = PBXBuildFile; fileRef = A1C4FB721BACD1B7003742D0 /* pages.pages */; };
 		A1DF74321C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1DF74301C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm */; };
+		A1EC11881F42541200D0146E /* PreviewLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1EC11871F42541200D0146E /* PreviewLoader.cpp */; };
 		A57A34F216AF6B2B00C2501F /* PageVisibilityStateWithWindowChanges.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A57A34F116AF69E200C2501F /* PageVisibilityStateWithWindowChanges.html */; };
 		A57D54F31F338C3600A97AA7 /* NeverDestroyed.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A57D54F21F338C3600A97AA7 /* NeverDestroyed.cpp */; };
 		A57D54F61F3395D000A97AA7 /* Logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A57D54F41F3395D000A97AA7 /* Logger.cpp */; };
@@ -1480,6 +1481,7 @@
 		A1C4FB6C1BACCE50003742D0 /* QuickLook.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QuickLook.mm; sourceTree = "<group>"; };
 		A1C4FB721BACD1B7003742D0 /* pages.pages */ = {isa = PBXFileReference; lastKnownFileType = file; name = pages.pages; path = ios/pages.pages; sourceTree = SOURCE_ROOT; };
 		A1DF74301C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AlwaysRevalidatedURLSchemes.mm; sourceTree = "<group>"; };
+		A1EC11871F42541200D0146E /* PreviewLoader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PreviewLoader.cpp; sourceTree = "<group>"; };
 		A1FDFD2E19C288BB005148A4 /* WKImageCreateCGImageCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKImageCreateCGImageCrash.cpp; sourceTree = "<group>"; };
 		A57A34EF16AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageVisibilityStateWithWindowChanges.mm; sourceTree = "<group>"; };
 		A57A34F116AF69E200C2501F /* PageVisibilityStateWithWindowChanges.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = PageVisibilityStateWithWindowChanges.html; sourceTree = "<group>"; };
@@ -2000,6 +2002,7 @@
 			isa = PBXGroup;
 			children = (
 				CD89D0371C4EDB1300040A04 /* cocoa */,
+				A1EC11851F4253D900D0146E /* ios */,
 				3162AE9A1E6F2F8F000E4DBC /* mac */,
 				7A909A6F1D877475007E10F8 /* AffineTransform.cpp */,
 				93A720E518F1A0E800A848E1 /* CalculationValue.cpp */,
@@ -2217,6 +2220,14 @@
 			name = Resources;
 			sourceTree = "<group>";
 		};
+		A1EC11851F4253D900D0146E /* ios */ = {
+			isa = PBXGroup;
+			children = (
+				A1EC11871F42541200D0146E /* PreviewLoader.cpp */,
+			);
+			path = ios;
+			sourceTree = "<group>";
+		};
 		BC029B1A1486B23800817DA9 /* ns */ = {
 			isa = PBXGroup;
 			children = (
@@ -3238,6 +3249,7 @@
 				7C1AF7951E8DCBAB002645B9 /* PrepareForMoveToWindow.mm in Sources */,
 				7CCE7F0B1A411AE600447C4C /* PreventEmptyUserAgent.cpp in Sources */,
 				7CCE7F2C1A411B1000447C4C /* PreventImageLoadWithAutoResizing.mm in Sources */,
+				A1EC11881F42541200D0146E /* PreviewLoader.cpp in Sources */,
 				7CCE7F0C1A411AE600447C4C /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */,
 				4647B1261EBA3B850041D7EF /* ProcessDidTerminate.cpp in Sources */,
 				7C83E0C11D0A652F00FEBCF3 /* ProvisionalURLNotChange.mm in Sources */,

Copied: trunk/Tools/TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp (from rev 220721, trunk/Source/WebCore/loader/ios/PreviewLoader.h) (0 => 220722)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp	2017-08-14 23:21:03 UTC (rev 220722)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if PLATFORM(IOS)
+
+#include <WebCore/PreviewLoader.h>
+#include <wtf/text/WTFString.h>
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+TEST(QuickLook, ShouldCreateForMIMEType)
+{
+    // FIXME: Expand this to cover all the MIME types we expect to support.
+    EXPECT_FALSE(PreviewLoader::shouldCreateForMIMEType(String()));
+    EXPECT_FALSE(PreviewLoader::shouldCreateForMIMEType(emptyString()));
+    EXPECT_TRUE(PreviewLoader::shouldCreateForMIMEType(ASCIILiteral("application/vnd.ms-excel.sheet.macroEnabled.12")));
+}
+
+} // namespace TestWebKitAPI
+
+#endif // PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to