Diff
Modified: branches/safari-604.1.38.0-branch/Source/WebCore/ChangeLog (220747 => 220748)
--- branches/safari-604.1.38.0-branch/Source/WebCore/ChangeLog 2017-08-15 17:47:10 UTC (rev 220747)
+++ branches/safari-604.1.38.0-branch/Source/WebCore/ChangeLog 2017-08-15 17:50:05 UTC (rev 220748)
@@ -1,3 +1,23 @@
+2017-08-15 Matthew Hanson <matthew_han...@apple.com>
+
+ Cherry-pick r220722. rdar://problem/33890575
+
+ 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 Jason Marcell <jmarc...@apple.com>
Revert r217197. rdar://problem/33890636
Modified: branches/safari-604.1.38.0-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (220747 => 220748)
--- branches/safari-604.1.38.0-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-08-15 17:47:10 UTC (rev 220747)
+++ branches/safari-604.1.38.0-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-08-15 17:50:05 UTC (rev 220748)
@@ -4303,7 +4303,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 */; };
Modified: branches/safari-604.1.38.0-branch/Source/WebCore/loader/ios/PreviewLoader.h (220747 => 220748)
--- branches/safari-604.1.38.0-branch/Source/WebCore/loader/ios/PreviewLoader.h 2017-08-15 17:47:10 UTC (rev 220747)
+++ branches/safari-604.1.38.0-branch/Source/WebCore/loader/ios/PreviewLoader.h 2017-08-15 17:50:05 UTC (rev 220748)
@@ -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: branches/safari-604.1.38.0-branch/Source/WebCore/loader/ios/PreviewLoader.mm (220747 => 220748)
--- branches/safari-604.1.38.0-branch/Source/WebCore/loader/ios/PreviewLoader.mm 2017-08-15 17:47:10 UTC (rev 220747)
+++ branches/safari-604.1.38.0-branch/Source/WebCore/loader/ios/PreviewLoader.mm 2017-08-15 17:50:05 UTC (rev 220748)
@@ -210,6 +210,9 @@
supportedMIMETypes.get().add(mimeType);
});
+ if (mimeType.isNull())
+ return false;
+
return supportedMIMETypes.get().contains(mimeType);
}
Modified: branches/safari-604.1.38.0-branch/Tools/ChangeLog (220747 => 220748)
--- branches/safari-604.1.38.0-branch/Tools/ChangeLog 2017-08-15 17:47:10 UTC (rev 220747)
+++ branches/safari-604.1.38.0-branch/Tools/ChangeLog 2017-08-15 17:50:05 UTC (rev 220748)
@@ -1,3 +1,19 @@
+2017-08-15 Matthew Hanson <matthew_han...@apple.com>
+
+ Cherry-pick r220722. rdar://problem/33890575
+
+ 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-09 Jason Marcell <jmarc...@apple.com>
Cherry-pick r220459. rdar://problem/33820787
Modified: branches/safari-604.1.38.0-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (220747 => 220748)
--- branches/safari-604.1.38.0-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2017-08-15 17:47:10 UTC (rev 220747)
+++ branches/safari-604.1.38.0-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2017-08-15 17:50:05 UTC (rev 220748)
@@ -549,6 +549,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 */; };
A5E2027515B21F6E00C13E14 /* WindowlessWebViewWithMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */; };
AD57AC201DA7465000FF1BDE /* DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD57AC1E1DA7464D00FF1BDE /* DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp */; };
@@ -1452,6 +1453,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>"; };
@@ -1962,6 +1964,7 @@
isa = PBXGroup;
children = (
CD89D0371C4EDB1300040A04 /* cocoa */,
+ A1EC11851F4253D900D0146E /* ios */,
3162AE9A1E6F2F8F000E4DBC /* mac */,
7A909A6F1D877475007E10F8 /* AffineTransform.cpp */,
93A720E518F1A0E800A848E1 /* CalculationValue.cpp */,
@@ -2175,6 +2178,14 @@
name = Resources;
sourceTree = "<group>";
};
+ A1EC11851F4253D900D0146E /* ios */ = {
+ isa = PBXGroup;
+ children = (
+ A1EC11871F42541200D0146E /* PreviewLoader.cpp */,
+ );
+ path = ios;
+ sourceTree = "<group>";
+ };
BC029B1A1486B23800817DA9 /* ns */ = {
isa = PBXGroup;
children = (
@@ -3184,6 +3195,7 @@
7CCE7F0B1A411AE600447C4C /* PreventEmptyUserAgent.cpp in Sources */,
7CCE7F2C1A411B1000447C4C /* PreventImageLoadWithAutoResizing.mm in Sources */,
C9E6DD351EA97D0800DD78AA /* FirstResponderSuppression.mm in Sources */,
+ A1EC11881F42541200D0146E /* PreviewLoader.cpp in Sources */,
7CCE7F0C1A411AE600447C4C /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */,
7C83E0C11D0A652F00FEBCF3 /* ProvisionalURLNotChange.mm in Sources */,
7CCE7EC81A411A7E00447C4C /* PublicSuffix.mm in Sources */,
Copied: branches/safari-604.1.38.0-branch/Tools/TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp (from rev 220745, branches/safari-604.1.38.0-branch/Source/WebCore/loader/ios/PreviewLoader.h) (0 => 220748)
--- branches/safari-604.1.38.0-branch/Tools/TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp (rev 0)
+++ branches/safari-604.1.38.0-branch/Tools/TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp 2017-08-15 17:50:05 UTC (rev 220748)
@@ -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)