Title: [183574] tags/Safari-601.1.31/Source/WebCore

Diff

Modified: tags/Safari-601.1.31/Source/WebCore/ChangeLog (183573 => 183574)


--- tags/Safari-601.1.31/Source/WebCore/ChangeLog	2015-04-29 20:27:53 UTC (rev 183573)
+++ tags/Safari-601.1.31/Source/WebCore/ChangeLog	2015-04-29 20:50:29 UTC (rev 183574)
@@ -1,5 +1,27 @@
 2015-04-29  Babak Shafiei  <[email protected]>
 
+        Merge r183568.
+
+    2015-04-29  Commit Queue  <[email protected]>
+
+            Unreviewed, rolling out r183553 and r183561.
+            https://bugs.webkit.org/show_bug.cgi?id=144406
+
+            broke the iOS build (Requested by thorton__ on #webkit).
+
+            Reverted changesets:
+
+            "Switch QuickLook soft-linking to use
+            QuickLookSoftLink.{h,mm}"
+            https://bugs.webkit.org/show_bug.cgi?id=144362
+            http://trac.webkit.org/changeset/183553
+
+            "Unreviewed iOS build fix after r183553: fix declaration of
+            QLPreviewScheme"
+            http://trac.webkit.org/changeset/183561
+
+2015-04-29  Babak Shafiei  <[email protected]>
+
         Merge r183561.
 
     2015-04-29  Jer Noble  <[email protected]>

Modified: tags/Safari-601.1.31/Source/WebCore/WebCore.xcodeproj/project.pbxproj (183573 => 183574)


--- tags/Safari-601.1.31/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-04-29 20:27:53 UTC (rev 183573)
+++ tags/Safari-601.1.31/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-04-29 20:50:29 UTC (rev 183574)
@@ -1599,9 +1599,7 @@
 		44311CD912E4E257000A8D19 /* DOMDocumentFragmentPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 44311CD412E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h */; };
 		44311F8212E4E66C000A8D19 /* DOMDocumentFragmentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711450AC5D5340053270F /* DOMDocumentFragmentInternal.h */; };
 		443817FF1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 443817FD1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp */; };
-		443917FF1A91B2F8006E04F2 /* QuickLookSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 443917FD1A91B2F8006E04F2 /* QuickLookSoftLink.mm */; };
 		443818001A91B2F8006E04F2 /* CoreMediaSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 443817FE1A91B2F8006E04F2 /* CoreMediaSoftLink.h */; };
-		443918001A91B2F8006E04F2 /* QuickLookSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 443917FE1A91B2F8006E04F2 /* QuickLookSoftLink.h */; };
 		443F04270E75C8FB007E5407 /* NetworkStateNotifierIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 443F04260E75C8FB007E5407 /* NetworkStateNotifierIOS.mm */; };
 		4449A4051A964B0000B64AD5 /* CoreMediaSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 4449A4041A964B0000B64AD5 /* CoreMediaSPI.h */; };
 		444D4E230F708B2E003158E0 /* WebCoreURLResponseIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */; };
@@ -8763,9 +8761,7 @@
 		44311CD412E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDocumentFragmentPrivate.h; sourceTree = "<group>"; };
 		44311CD512E4E22D000A8D19 /* DOMDocumentPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDocumentPrivate.h; sourceTree = "<group>"; };
 		443817FD1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoreMediaSoftLink.cpp; sourceTree = "<group>"; };
-		443917FD1A91B2F8006E04F2 /* QuickLookSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ios/QuickLookSoftLink.mm; sourceTree = "<group>"; };
 		443817FE1A91B2F8006E04F2 /* CoreMediaSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreMediaSoftLink.h; sourceTree = "<group>"; };
-		443917FE1A91B2F8006E04F2 /* QuickLookSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ios/QuickLookSoftLink.h; sourceTree = "<group>"; };
 		443F04260E75C8FB007E5407 /* NetworkStateNotifierIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkStateNotifierIOS.mm; sourceTree = "<group>"; };
 		4449A4041A964B0000B64AD5 /* CoreMediaSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreMediaSPI.h; sourceTree = "<group>"; };
 		444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponseIOS.mm; sourceTree = "<group>"; };
@@ -18847,8 +18843,6 @@
 				C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */,
 				E45390320EAFD637003695C8 /* PlatformScreenIOS.mm */,
 				AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */,
-				443917FE1A91B2F8006E04F2 /* QuickLookSoftLink.h */,
-				443917FD1A91B2F8006E04F2 /* QuickLookSoftLink.mm */,
 				CDFC360118CA61630026E56F /* RemoteCommandListenerIOS.h */,
 				CDFC360218CA61630026E56F /* RemoteCommandListenerIOS.mm */,
 				44C363EE0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h */,
@@ -26047,7 +26041,6 @@
 				550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */,
 				CE12523D1A1676CD00864480 /* QuartzCoreSPI.h in Headers */,
 				442AF7A9102CDDEA008FD4D3 /* QuickLook.h in Headers */,
-				443918001A91B2F8006E04F2 /* QuickLookSoftLink.h in Headers */,
 				A149786F1ABAF33800CEF7E4 /* ContentFilter.h in Headers */,
 				CE1252391A166FA000864480 /* QuickLookSPI.h in Headers */,
 				A10DBF4718F92317000D70C6 /* QuickLookHandleClient.h in Headers */,
@@ -29547,7 +29540,6 @@
 				CDEE393717974259001D7580 /* PublicURLManager.cpp in Sources */,
 				550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */,
 				442AF7AA102CDDEA008FD4D3 /* QuickLook.mm in Sources */,
-				443917FF1A91B2F8006E04F2 /* QuickLookSoftLink.mm in Sources */,
 				072AE1E6183C0741000A5988 /* QuickTimePluginReplacement.mm in Sources */,
 				379E371613736A6600B9E919 /* QuotedPrintable.cpp in Sources */,
 				5A574F28131DB96D00471B88 /* QuotesData.cpp in Sources */,

Deleted: tags/Safari-601.1.31/Source/WebCore/platform/ios/QuickLookSoftLink.h (183573 => 183574)


--- tags/Safari-601.1.31/Source/WebCore/platform/ios/QuickLookSoftLink.h	2015-04-29 20:27:53 UTC (rev 183573)
+++ tags/Safari-601.1.31/Source/WebCore/platform/ios/QuickLookSoftLink.h	2015-04-29 20:50:29 UTC (rev 183574)
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#if USE(QUICK_LOOK)
-
-#include "QuickLookSPI.h"
-#include "SoftLinking.h"
-
-SOFT_LINK_FRAMEWORK_FOR_HEADER(WebCore, QuickLook)
-
-SOFT_LINK_CLASS_FOR_HEADER(WebCore, QuickLook, QLPreviewConverter)
-
-SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, QuickLook, QLPreviewGetSupportedMIMETypes, NSSet *, (), ())
-#define QLPreviewGetSupportedMIMETypes softLink_QuickLook_QLPreviewGetSupportedMIMETypes
-SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, QuickLook, QLTypeCopyBestMimeTypeForFileNameAndMimeType, NSString *, (NSString *fileName, NSString *mimeType), (fileName, mimeType))
-#define QLTypeCopyBestMimeTypeForFileNameAndMimeType softLink_QuickLook_QLTypeCopyBestMimeTypeForFileNameAndMimeType
-SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, QuickLook, QLTypeCopyBestMimeTypeForURLAndMimeType, NSString *, (NSURL *url, NSString *mimeType), (url, mimeType))
-#define QLTypeCopyBestMimeTypeForURLAndMimeType softLink_QuickLook_QLTypeCopyBestMimeTypeForURLAndMimeType
-SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, QuickLook, QLTypeCopyUTIForURLAndMimeType, NSString *, (NSURL *url, NSString *mimeType), (url, mimeType))
-#define QLTypeCopyUTIForURLAndMimeType softLink_QuickLook_QLTypeCopyUTIForURLAndMimeType
-
-SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, QuickLook, QLPreviewScheme, NSString *)
-#define QLPreviewScheme get_QuickLook_QLPreviewScheme()
-
-#endif // USE(QUICK_LOOK)

Deleted: tags/Safari-601.1.31/Source/WebCore/platform/ios/QuickLookSoftLink.mm (183573 => 183574)


--- tags/Safari-601.1.31/Source/WebCore/platform/ios/QuickLookSoftLink.mm	2015-04-29 20:27:53 UTC (rev 183573)
+++ tags/Safari-601.1.31/Source/WebCore/platform/ios/QuickLookSoftLink.mm	2015-04-29 20:50:29 UTC (rev 183574)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#import "config.h"
-
-#if USE(QUICK_LOOK)
-
-#import "QuickLookSPI.h"
-#import "SoftLinking.h"
-
-SOFT_LINK_FRAMEWORK_FOR_SOURCE(WebCore, QuickLook)
-
-SOFT_LINK_CLASS_FOR_SOURCE(WebCore, QuickLook, QLPreviewConverter)
-
-SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, QuickLook, QLPreviewGetSupportedMIMETypes, NSSet *, (), ())
-SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, QuickLook, QLTypeCopyBestMimeTypeForFileNameAndMimeType, NSString *, (NSString *fileName, NSString *mimeType), (fileName, mimeType))
-SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, QuickLook, QLTypeCopyBestMimeTypeForURLAndMimeType, NSString *, (NSURL *url, NSString *mimeType), (url, mimeType))
-SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, QuickLook, QLTypeCopyUTIForURLAndMimeType, NSString *, (NSURL *url, NSString *mimeType), (url, mimeType))
-
-SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, QuickLook, QLPreviewScheme, NSString * const)
-
-#endif // USE(QUICK_LOOK)

Modified: tags/Safari-601.1.31/Source/WebCore/platform/mac/SoftLinking.h (183573 => 183574)


--- tags/Safari-601.1.31/Source/WebCore/platform/mac/SoftLinking.h	2015-04-29 20:27:53 UTC (rev 183573)
+++ tags/Safari-601.1.31/Source/WebCore/platform/mac/SoftLinking.h	2015-04-29 20:50:29 UTC (rev 183574)
@@ -317,42 +317,6 @@
     } \
     }
 
-#define SOFT_LINK_CLASS_FOR_HEADER(functionNamespace, framework, className) \
-    @class className; \
-    namespace functionNamespace { \
-    extern Class (*get_##framework##_##className##Class)(); \
-    className *alloc##className##Instance(); \
-    inline className *alloc##className##Instance() \
-    { \
-        return [get_##framework##_##className##Class() alloc]; \
-    } \
-    }
-
-#define SOFT_LINK_CLASS_FOR_SOURCE(functionNamespace, framework, className) \
-    @class className; \
-    namespace functionNamespace { \
-    static Class init##className(); \
-    Class (*get_##framework##_##className##Class)() = init##className; \
-    static Class class##className; \
-    \
-    static Class className##Function() \
-    { \
-        return class##className; \
-    } \
-    \
-    static Class init##className() \
-    { \
-        static dispatch_once_t once; \
-        dispatch_once(&once, ^{ \
-            framework##Library(); \
-            class##className = objc_getClass(#className); \
-            RELEASE_ASSERT(class##className); \
-            get_##framework##_##className##Class = className##Function; \
-        }); \
-        return class##className; \
-    } \
-    }
-
 #define SOFT_LINK_CONSTANT_FOR_HEADER(functionNamespace, framework, variableName, variableType) \
     WTF_EXTERN_C_BEGIN \
     extern const variableType variableName; \

Modified: tags/Safari-601.1.31/Source/WebCore/platform/network/ios/QuickLook.h (183573 => 183574)


--- tags/Safari-601.1.31/Source/WebCore/platform/network/ios/QuickLook.h	2015-04-29 20:27:53 UTC (rev 183573)
+++ tags/Safari-601.1.31/Source/WebCore/platform/network/ios/QuickLook.h	2015-04-29 20:50:29 UTC (rev 183574)
@@ -57,6 +57,10 @@
 class ResourceResponse;
 class SynchronousResourceHandleCFURLConnectionDelegate;
 
+Class QLPreviewConverterClass();
+NSString *QLTypeCopyBestMimeTypeForFileNameAndMimeType(NSString *fileName, NSString *mimeType);
+NSString *QLTypeCopyBestMimeTypeForURLAndMimeType(NSURL *, NSString *mimeType);
+
 WEBCORE_EXPORT NSSet *QLPreviewGetSupportedMIMETypesSet();
 
 // Used for setting the permissions on the saved QL content

Modified: tags/Safari-601.1.31/Source/WebCore/platform/network/ios/QuickLook.mm (183573 => 183574)


--- tags/Safari-601.1.31/Source/WebCore/platform/network/ios/QuickLook.mm	2015-04-29 20:27:53 UTC (rev 183573)
+++ tags/Safari-601.1.31/Source/WebCore/platform/network/ios/QuickLook.mm	2015-04-29 20:50:29 UTC (rev 183574)
@@ -32,11 +32,12 @@
 #import "FileSystemIOS.h"
 #import "Logging.h"
 #import "NSFileManagerSPI.h"
-#import "QuickLookSoftLink.h"
+#import "QuickLookSPI.h"
 #import "ResourceError.h"
 #import "ResourceHandle.h"
 #import "ResourceLoader.h"
 #import "RuntimeApplicationChecksIOS.h"
+#import "SoftLinking.h"
 #import "SynchronousResourceHandleCFURLConnectionDelegate.h"
 #import "WebCoreURLResponseIOS.h"
 #import <Foundation/Foundation.h>
@@ -55,14 +56,60 @@
 @end
 #endif
 
+SOFT_LINK_FRAMEWORK_OPTIONAL(QuickLook)
+SOFT_LINK_CLASS(QuickLook, QLPreviewConverter)
+SOFT_LINK_MAY_FAIL(QuickLook, QLPreviewGetSupportedMIMETypes, NSSet *, (), ())
+SOFT_LINK_MAY_FAIL(QuickLook, QLTypeCopyBestMimeTypeForFileNameAndMimeType, NSString *, (NSString *fileName, NSString *mimeType), (fileName, mimeType))
+SOFT_LINK_MAY_FAIL(QuickLook, QLTypeCopyBestMimeTypeForURLAndMimeType, NSString *, (NSURL *url, NSString *mimeType), (url, mimeType))
+SOFT_LINK_MAY_FAIL(QuickLook, QLTypeCopyUTIForURLAndMimeType, NSString *, (NSURL *url, NSString *mimeType), (url, mimeType))
+SOFT_LINK_CONSTANT_MAY_FAIL(QuickLook, QLPreviewScheme, NSString *)
+
+namespace WebCore {
+    NSString *QLTypeCopyUTIForURLAndMimeType(NSURL *url, NSString *mimeType);
+}
+
 using namespace WebCore;
 
+Class WebCore::QLPreviewConverterClass()
+{
+#define QLPreviewConverter getQLPreviewConverterClass()
+    return QLPreviewConverter;
+#undef QLPreviewConverter
+}
+
+NSString *WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType(NSString *fileName, NSString *mimeType)
+{
+    if (!canLoadQLTypeCopyBestMimeTypeForFileNameAndMimeType())
+        return nil;
+
+    return ::QLTypeCopyBestMimeTypeForFileNameAndMimeType(fileName, mimeType);
+}
+
+NSString *WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType(NSURL *url, NSString *mimeType)
+{
+    if (!canLoadQLTypeCopyBestMimeTypeForURLAndMimeType())
+        return nil;
+
+    return ::QLTypeCopyBestMimeTypeForURLAndMimeType(url, mimeType);
+}
+
 NSSet *WebCore::QLPreviewGetSupportedMIMETypesSet()
 {
-    static NeverDestroyed<RetainPtr<NSSet>> set = QLPreviewGetSupportedMIMETypes();
-    return set.get().get();
+    if (!canLoadQLPreviewGetSupportedMIMETypes())
+        return nil;
+
+    static NSSet *set = adoptNS(::QLPreviewGetSupportedMIMETypes()).leakRef();
+    return set;
 }
 
+NSString *WebCore::QLTypeCopyUTIForURLAndMimeType(NSURL *url, NSString *mimeType)
+{
+    if (!canLoadQLTypeCopyUTIForURLAndMimeType())
+        return nil;
+
+    return ::QLTypeCopyUTIForURLAndMimeType(url, mimeType);
+}
+
 NSDictionary *WebCore::QLFileAttributes()
 {
     // Set file perms to owner read/write only
@@ -143,12 +190,12 @@
 
 RetainPtr<NSURLRequest> WebCore::registerQLPreviewConverterIfNeeded(NSURL *url, NSString *mimeType, NSData *data)
 {
-    RetainPtr<NSString> updatedMIMEType = adoptNS(QLTypeCopyBestMimeTypeForURLAndMimeType(url, mimeType));
+    RetainPtr<NSString> updatedMIMEType = adoptNS(WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType(url, mimeType));
 
-    if ([QLPreviewGetSupportedMIMETypesSet() containsObject:updatedMIMEType.get()]) {
-        RetainPtr<NSString> uti = adoptNS(QLTypeCopyUTIForURLAndMimeType(url, updatedMIMEType.get()));
+    if ([WebCore::QLPreviewGetSupportedMIMETypesSet() containsObject:updatedMIMEType.get()]) {
+        RetainPtr<NSString> uti = adoptNS(WebCore::QLTypeCopyUTIForURLAndMimeType(url, updatedMIMEType.get()));
 
-        RetainPtr<QLPreviewConverter> converter = adoptNS([allocQLPreviewConverterInstance() initWithData:data name:nil uti:uti.get() options:nil]);
+        RetainPtr<id> converter = adoptNS([allocQLPreviewConverterInstance() initWithData:data name:nil uti:uti.get() options:nil]);
         NSURLRequest *request = [converter previewRequest];
 
         // We use [request URL] here instead of url since it will be
@@ -181,13 +228,18 @@
 static Vector<char> createQLPreviewProtocol()
 {
     Vector<char> previewProtocol;
+#define QLPreviewScheme getQLPreviewScheme()
     const char* qlPreviewScheme = [QLPreviewScheme UTF8String];
+#undef QLPreviewScheme
     previewProtocol.append(qlPreviewScheme, strlen(qlPreviewScheme) + 1);
     return previewProtocol;
 }
 
 const char* WebCore::QLPreviewProtocol()
 {
+    if (!canLoadQLPreviewScheme())
+        return "";
+
     static NeverDestroyed<Vector<char>> previewProtocol(createQLPreviewProtocol());
     return previewProtocol.get().data();
 }
@@ -407,7 +459,7 @@
 std::unique_ptr<QuickLookHandle> QuickLookHandle::create(ResourceHandle* handle, NSURLConnection *connection, NSURLResponse *nsResponse, id delegate)
 {
     ASSERT_ARG(handle, handle);
-    if (handle->firstRequest().requester() != ResourceRequest::Requester::Main || ![QLPreviewGetSupportedMIMETypesSet() containsObject:[nsResponse MIMEType]])
+    if (handle->firstRequest().requester() != ResourceRequest::Requester::Main || ![WebCore::QLPreviewGetSupportedMIMETypesSet() containsObject:[nsResponse MIMEType]])
         return nullptr;
 
     std::unique_ptr<QuickLookHandle> quickLookHandle(new QuickLookHandle([handle->firstRequest().nsURLRequest(DoNotUpdateHTTPBody) URL], connection, nsResponse, delegate));
@@ -419,7 +471,7 @@
 std::unique_ptr<QuickLookHandle> QuickLookHandle::create(ResourceHandle* handle, SynchronousResourceHandleCFURLConnectionDelegate* connectionDelegate, CFURLResponseRef cfResponse)
 {
     ASSERT_ARG(handle, handle);
-    if (handle->firstRequest().requester() != ResourceRequest::Requester::Main || ![QLPreviewGetSupportedMIMETypesSet() containsObject:(NSString *)CFURLResponseGetMIMEType(cfResponse)])
+    if (handle->firstRequest().requester() != ResourceRequest::Requester::Main || ![WebCore::QLPreviewGetSupportedMIMETypesSet() containsObject:(NSString *)CFURLResponseGetMIMEType(cfResponse)])
         return nullptr;
 
     NSURLResponse *nsResponse = [NSURLResponse _responseWithCFURLResponse:cfResponse];
@@ -437,7 +489,7 @@
 
 bool QuickLookHandle::shouldCreateForMIMEType(const String& mimeType)
 {
-    return [QLPreviewGetSupportedMIMETypesSet() containsObject:mimeType];
+    return [WebCore::QLPreviewGetSupportedMIMETypesSet() containsObject:mimeType];
 }
 
 std::unique_ptr<QuickLookHandle> QuickLookHandle::create(ResourceLoader& loader, const ResourceResponse& response)

Modified: tags/Safari-601.1.31/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm (183573 => 183574)


--- tags/Safari-601.1.31/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm	2015-04-29 20:27:53 UTC (rev 183573)
+++ tags/Safari-601.1.31/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm	2015-04-29 20:50:29 UTC (rev 183574)
@@ -32,7 +32,6 @@
 #import "WebCoreSystemInterface.h"
 
 #import "QuickLook.h"
-#import "QuickLookSoftLink.h"
 #import "SoftLinking.h"
 #import <MobileCoreServices/MobileCoreServices.h>
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to