Split platform specific parts of NetworkCacheCoders.cpp into separate files
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jul 2016 18:01:34 +0000 (18:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jul 2016 18:01:34 +0000 (18:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=160151

Patch by Sam Weinig <sam@webkit.org> on 2016-07-25
Reviewed by Alex Christensen.

* NetworkProcess/cache/NetworkCacheCoders.cpp:
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
* NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.cpp.
(WebKit::NetworkCache::encodeCFData): Moved.
(WebKit::NetworkCache::decodeCFData): Moved.
(WebKit::NetworkCache::encodeSecTrustRef): Moved.
(WebKit::NetworkCache::decodeSecTrustRef): Moved.
(WebKit::NetworkCache::encodeCertificateChain): Moved.
(WebKit::NetworkCache::decodeCertificateChain): Moved.
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Moved.
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Moved.
* NetworkProcess/cache/NetworkCacheCodersSoup.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.cpp.
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Moved.
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Moved.

* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebKit2.xcodeproj/project.pbxproj:
Add new files.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203691 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCacheCodersCocoa.cpp [new file with mode: 0644]
Source/WebKit2/NetworkProcess/cache/NetworkCacheCodersSoup.cpp [new file with mode: 0644]
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/PlatformMac.cmake
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

index cc71287..4fde804 100644 (file)
@@ -1,3 +1,31 @@
+2016-07-25  Sam Weinig  <sam@webkit.org>
+
+        Split platform specific parts of NetworkCacheCoders.cpp into separate files
+        https://bugs.webkit.org/show_bug.cgi?id=160151
+
+        Reviewed by Alex Christensen.
+
+        * NetworkProcess/cache/NetworkCacheCoders.cpp:
+        (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
+        (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
+        * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.cpp.
+        (WebKit::NetworkCache::encodeCFData): Moved.
+        (WebKit::NetworkCache::decodeCFData): Moved.
+        (WebKit::NetworkCache::encodeSecTrustRef): Moved.
+        (WebKit::NetworkCache::decodeSecTrustRef): Moved.
+        (WebKit::NetworkCache::encodeCertificateChain): Moved.
+        (WebKit::NetworkCache::decodeCertificateChain): Moved.
+        (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Moved.
+        (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Moved.
+        * NetworkProcess/cache/NetworkCacheCodersSoup.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.cpp.
+        (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Moved.
+        (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Moved.
+
+        * PlatformGTK.cmake:
+        * PlatformMac.cmake:
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files.
+
 2016-07-25  Chris Dumez  <cdumez@apple.com>
 
         [iOS] Make sure we call the ProcessAssertion invalidation handler on the main thread
index 03f1283..b883686 100644 (file)
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
-#if PLATFORM(COCOA)
-#include <Security/SecCertificate.h>
-#include <Security/SecTrust.h>
-#include <wtf/spi/cocoa/SecuritySPI.h>
-#endif
-
 namespace WebKit {
 namespace NetworkCache {
 
@@ -150,215 +144,6 @@ bool Coder<String>::decode(Decoder& decoder, String& result)
     return decodeStringText<UChar>(decoder, length, result);
 }
 
-#if PLATFORM(COCOA)
-static void encodeCFData(Encoder& encoder, CFDataRef data)
-{
-    uint64_t length = CFDataGetLength(data);
-    const uint8_t* bytePtr = CFDataGetBytePtr(data);
-
-    encoder << length;
-    encoder.encodeFixedLengthData(bytePtr, length);
-}
-
-static bool decodeCFData(Decoder& decoder, RetainPtr<CFDataRef>& data)
-{
-    uint64_t size = 0;
-    if (!decoder.decode(size))
-        return false;
-
-    Vector<uint8_t> vector(size);
-    if (!decoder.decodeFixedLengthData(vector.data(), vector.size()))
-        return false;
-
-    data = adoptCF(CFDataCreate(nullptr, vector.data(), vector.size()));
-    return true;
-}
-
-
-#if HAVE(SEC_TRUST_SERIALIZATION)
-static void encodeSecTrustRef(Encoder& encoder, SecTrustRef trust)
-{
-    auto data = adoptCF(SecTrustSerialize(trust, nullptr));
-    if (!data) {
-        encoder << false;
-        return;
-    }
-
-    encoder << true;
-    encodeCFData(encoder, data.get());
-}
-
-static bool decodeSecTrustRef(Decoder& decoder, RetainPtr<SecTrustRef>& result)
-{
-    bool hasTrust;
-    if (!decoder.decode(hasTrust))
-        return false;
-
-    if (!hasTrust)
-        return true;
-
-    RetainPtr<CFDataRef> trustData;
-    if (!decodeCFData(decoder, trustData))
-        return false;
-
-    auto trust = adoptCF(SecTrustDeserialize(trustData.get(), nullptr));
-    if (!trust)
-        return false;
-
-    result = WTFMove(trust);
-    return true;
-}
-#endif
-
-static void encodeCertificateChain(Encoder& encoder, CFArrayRef certificateChain)
-{
-    CFIndex size = CFArrayGetCount(certificateChain);
-    Vector<CFTypeRef, 32> values(size);
-
-    CFArrayGetValues(certificateChain, CFRangeMake(0, size), values.data());
-
-    encoder << static_cast<uint64_t>(size);
-
-    for (CFIndex i = 0; i < size; ++i) {
-        ASSERT(values[i]);
-        ASSERT(CFGetTypeID(values[i]) != SecCertificateGetTypeID());
-
-        auto data = adoptCF(SecCertificateCopyData((SecCertificateRef)values[i]));
-        encodeCFData(encoder, data.get());
-    }
-}
-
-static bool decodeCertificateChain(Decoder& decoder, RetainPtr<CFArrayRef>& certificateChain)
-{
-    uint64_t size;
-    if (!decoder.decode(size))
-        return false;
-
-    auto array = adoptCF(CFArrayCreateMutable(0, 0, &kCFTypeArrayCallBacks));
-
-    for (size_t i = 0; i < size; ++i) {
-        RetainPtr<CFDataRef> data;
-        if (!decodeCFData(decoder, data))
-            return false;
-
-        auto certificate = adoptCF(SecCertificateCreateWithData(0, data.get()));
-        CFArrayAppendValue(array.get(), certificate.get());
-    }
-
-    certificateChain = WTFMove(array);
-    return true;
-}
-
-void Coder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
-{
-    encoder.encodeEnum(certificateInfo.type());
-
-    switch (certificateInfo.type()) {
-#if HAVE(SEC_TRUST_SERIALIZATION)
-    case WebCore::CertificateInfo::Type::Trust:
-        encodeSecTrustRef(encoder, certificateInfo.trust());
-        break;
-#endif
-    case WebCore::CertificateInfo::Type::CertificateChain: {
-        encodeCertificateChain(encoder, certificateInfo.certificateChain());
-        break;
-    }
-    case WebCore::CertificateInfo::Type::None:
-        // Do nothing.
-        break;
-    }
-}
-
-bool Coder<WebCore::CertificateInfo>::decode(Decoder& decoder, WebCore::CertificateInfo& certificateInfo)
-{
-    WebCore::CertificateInfo::Type certificateInfoType;
-    if (!decoder.decodeEnum(certificateInfoType))
-        return false;
-
-    switch (certificateInfoType) {
-#if HAVE(SEC_TRUST_SERIALIZATION)
-    case WebCore::CertificateInfo::Type::Trust: {
-        RetainPtr<SecTrustRef> trust;
-        if (!decodeSecTrustRef(decoder, trust))
-            return false;
-
-        certificateInfo = WebCore::CertificateInfo(WTFMove(trust));
-        return true;
-    }
-#endif
-    case WebCore::CertificateInfo::Type::CertificateChain: {
-        RetainPtr<CFArrayRef> certificateChain;
-        if (!decodeCertificateChain(decoder, certificateChain))
-            return false;
-
-        certificateInfo = WebCore::CertificateInfo(WTFMove(certificateChain));
-        return true;
-    }    
-    case WebCore::CertificateInfo::Type::None:
-        // Do nothing.
-        break;
-    }
-
-    return true;
-}
-#else
-void Coder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
-{
-    if (!certificateInfo.certificate()) {
-        encoder << false;
-        return;
-    }
-
-    GByteArray* certificateData = 0;
-    g_object_get(G_OBJECT(certificateInfo.certificate()), "certificate", &certificateData, NULL);
-    if (!certificateData) {
-        encoder << false;
-        return;
-    }
-
-    encoder << true;
-
-    GRefPtr<GByteArray> certificate = adoptGRef(certificateData);
-    encoder << static_cast<uint64_t>(certificate->len);
-    encoder.encodeFixedLengthData(certificate->data, certificate->len);
-
-    encoder << static_cast<uint32_t>(certificateInfo.tlsErrors());
-}
-
-bool Coder<WebCore::CertificateInfo>::decode(Decoder& decoder, WebCore::CertificateInfo& certificateInfo)
-{
-    bool hasCertificate;
-    if (!decoder.decode(hasCertificate))
-        return false;
-
-    if (!hasCertificate)
-        return true;
-
-    uint64_t size = 0;
-    if (!decoder.decode(size))
-        return false;
-
-    Vector<uint8_t> vector(size);
-    if (!decoder.decodeFixedLengthData(vector.data(), vector.size()))
-        return false;
-
-    GByteArray* certificateData = g_byte_array_sized_new(vector.size());
-    certificateData = g_byte_array_append(certificateData, vector.data(), vector.size());
-    GRefPtr<GByteArray> certificateBytes = adoptGRef(certificateData);
-
-    GTlsBackend* backend = g_tls_backend_get_default();
-    GRefPtr<GTlsCertificate> certificate = adoptGRef(G_TLS_CERTIFICATE(g_initable_new(
-        g_tls_backend_get_certificate_type(backend), 0, 0, "certificate", certificateBytes.get(), nullptr)));
-    certificateInfo.setCertificate(certificate.get());
-
-    uint32_t tlsErrors;
-    if (!decoder.decode(tlsErrors))
-        return false;
-    certificateInfo.setTLSErrors(static_cast<GTlsCertificateFlags>(tlsErrors));
-
-    return true;
-}
-#endif
 
 void Coder<SHA1::Digest>::encode(Encoder& encoder, const SHA1::Digest& digest)
 {
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheCodersCocoa.cpp b/Source/WebKit2/NetworkProcess/cache/NetworkCacheCodersCocoa.cpp
new file mode 100644 (file)
index 0000000..04bdcfb
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2011, 2014-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.
+ */
+
+#include "config.h"
+#include "NetworkCacheCoders.h"
+
+#if ENABLE(NETWORK_CACHE)
+
+#if PLATFORM(COCOA)
+#include <Security/SecCertificate.h>
+#include <Security/SecTrust.h>
+#include <wtf/spi/cocoa/SecuritySPI.h>
+#endif
+
+namespace WebKit {
+namespace NetworkCache {
+
+static void encodeCFData(Encoder& encoder, CFDataRef data)
+{
+    uint64_t length = CFDataGetLength(data);
+    const uint8_t* bytePtr = CFDataGetBytePtr(data);
+
+    encoder << length;
+    encoder.encodeFixedLengthData(bytePtr, length);
+}
+
+static bool decodeCFData(Decoder& decoder, RetainPtr<CFDataRef>& data)
+{
+    uint64_t size = 0;
+    if (!decoder.decode(size))
+        return false;
+
+    Vector<uint8_t> vector(size);
+    if (!decoder.decodeFixedLengthData(vector.data(), vector.size()))
+        return false;
+
+    data = adoptCF(CFDataCreate(nullptr, vector.data(), vector.size()));
+    return true;
+}
+
+
+#if HAVE(SEC_TRUST_SERIALIZATION)
+static void encodeSecTrustRef(Encoder& encoder, SecTrustRef trust)
+{
+    auto data = adoptCF(SecTrustSerialize(trust, nullptr));
+    if (!data) {
+        encoder << false;
+        return;
+    }
+
+    encoder << true;
+    encodeCFData(encoder, data.get());
+}
+
+static bool decodeSecTrustRef(Decoder& decoder, RetainPtr<SecTrustRef>& result)
+{
+    bool hasTrust;
+    if (!decoder.decode(hasTrust))
+        return false;
+
+    if (!hasTrust)
+        return true;
+
+    RetainPtr<CFDataRef> trustData;
+    if (!decodeCFData(decoder, trustData))
+        return false;
+
+    auto trust = adoptCF(SecTrustDeserialize(trustData.get(), nullptr));
+    if (!trust)
+        return false;
+
+    result = WTFMove(trust);
+    return true;
+}
+#endif
+
+static void encodeCertificateChain(Encoder& encoder, CFArrayRef certificateChain)
+{
+    CFIndex size = CFArrayGetCount(certificateChain);
+    Vector<CFTypeRef, 32> values(size);
+
+    CFArrayGetValues(certificateChain, CFRangeMake(0, size), values.data());
+
+    encoder << static_cast<uint64_t>(size);
+
+    for (CFIndex i = 0; i < size; ++i) {
+        ASSERT(values[i]);
+        ASSERT(CFGetTypeID(values[i]) != SecCertificateGetTypeID());
+
+        auto data = adoptCF(SecCertificateCopyData((SecCertificateRef)values[i]));
+        encodeCFData(encoder, data.get());
+    }
+}
+
+static bool decodeCertificateChain(Decoder& decoder, RetainPtr<CFArrayRef>& certificateChain)
+{
+    uint64_t size;
+    if (!decoder.decode(size))
+        return false;
+
+    auto array = adoptCF(CFArrayCreateMutable(0, 0, &kCFTypeArrayCallBacks));
+
+    for (size_t i = 0; i < size; ++i) {
+        RetainPtr<CFDataRef> data;
+        if (!decodeCFData(decoder, data))
+            return false;
+
+        auto certificate = adoptCF(SecCertificateCreateWithData(0, data.get()));
+        CFArrayAppendValue(array.get(), certificate.get());
+    }
+
+    certificateChain = WTFMove(array);
+    return true;
+}
+
+void Coder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
+{
+    encoder.encodeEnum(certificateInfo.type());
+
+    switch (certificateInfo.type()) {
+#if HAVE(SEC_TRUST_SERIALIZATION)
+    case WebCore::CertificateInfo::Type::Trust:
+        encodeSecTrustRef(encoder, certificateInfo.trust());
+        break;
+#endif
+    case WebCore::CertificateInfo::Type::CertificateChain: {
+        encodeCertificateChain(encoder, certificateInfo.certificateChain());
+        break;
+    }
+    case WebCore::CertificateInfo::Type::None:
+        // Do nothing.
+        break;
+    }
+}
+
+bool Coder<WebCore::CertificateInfo>::decode(Decoder& decoder, WebCore::CertificateInfo& certificateInfo)
+{
+    WebCore::CertificateInfo::Type certificateInfoType;
+    if (!decoder.decodeEnum(certificateInfoType))
+        return false;
+
+    switch (certificateInfoType) {
+#if HAVE(SEC_TRUST_SERIALIZATION)
+    case WebCore::CertificateInfo::Type::Trust: {
+        RetainPtr<SecTrustRef> trust;
+        if (!decodeSecTrustRef(decoder, trust))
+            return false;
+
+        certificateInfo = WebCore::CertificateInfo(WTFMove(trust));
+        return true;
+    }
+#endif
+    case WebCore::CertificateInfo::Type::CertificateChain: {
+        RetainPtr<CFArrayRef> certificateChain;
+        if (!decodeCertificateChain(decoder, certificateChain))
+            return false;
+
+        certificateInfo = WebCore::CertificateInfo(WTFMove(certificateChain));
+        return true;
+    }    
+    case WebCore::CertificateInfo::Type::None:
+        // Do nothing.
+        break;
+    }
+
+    return true;
+}
+
+}
+}
+
+#endif
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheCodersSoup.cpp b/Source/WebKit2/NetworkProcess/cache/NetworkCacheCodersSoup.cpp
new file mode 100644 (file)
index 0000000..3a3338b
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2011, 2014-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.
+ */
+
+#include "config.h"
+#include "NetworkCacheCoders.h"
+
+#if ENABLE(NETWORK_CACHE)
+
+namespace WebKit {
+namespace NetworkCache {
+
+void Coder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
+{
+    if (!certificateInfo.certificate()) {
+        encoder << false;
+        return;
+    }
+
+    GByteArray* certificateData = 0;
+    g_object_get(G_OBJECT(certificateInfo.certificate()), "certificate", &certificateData, NULL);
+    if (!certificateData) {
+        encoder << false;
+        return;
+    }
+
+    encoder << true;
+
+    GRefPtr<GByteArray> certificate = adoptGRef(certificateData);
+    encoder << static_cast<uint64_t>(certificate->len);
+    encoder.encodeFixedLengthData(certificate->data, certificate->len);
+
+    encoder << static_cast<uint32_t>(certificateInfo.tlsErrors());
+}
+
+bool Coder<WebCore::CertificateInfo>::decode(Decoder& decoder, WebCore::CertificateInfo& certificateInfo)
+{
+    bool hasCertificate;
+    if (!decoder.decode(hasCertificate))
+        return false;
+
+    if (!hasCertificate)
+        return true;
+
+    uint64_t size = 0;
+    if (!decoder.decode(size))
+        return false;
+
+    Vector<uint8_t> vector(size);
+    if (!decoder.decodeFixedLengthData(vector.data(), vector.size()))
+        return false;
+
+    GByteArray* certificateData = g_byte_array_sized_new(vector.size());
+    certificateData = g_byte_array_append(certificateData, vector.data(), vector.size());
+    GRefPtr<GByteArray> certificateBytes = adoptGRef(certificateData);
+
+    GTlsBackend* backend = g_tls_backend_get_default();
+    GRefPtr<GTlsCertificate> certificate = adoptGRef(G_TLS_CERTIFICATE(g_initable_new(
+        g_tls_backend_get_certificate_type(backend), 0, 0, "certificate", certificateBytes.get(), nullptr)));
+    certificateInfo.setCertificate(certificate.get());
+
+    uint32_t tlsErrors;
+    if (!decoder.decode(tlsErrors))
+        return false;
+    certificateInfo.setTLSErrors(static_cast<GTlsCertificateFlags>(tlsErrors));
+
+    return true;
+}
+
+}
+}
+
+#endif
index fd21680..44f1efc 100644 (file)
@@ -34,6 +34,7 @@ list(APPEND WebKit2_SOURCES
 
     NetworkProcess/Downloads/soup/DownloadSoup.cpp
 
+    NetworkProcess/cache/NetworkCacheCodersSoup.cpp
     NetworkProcess/cache/NetworkCacheDataSoup.cpp
     NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp
 
index c1c6577..2a13e14 100644 (file)
@@ -30,6 +30,7 @@ list(APPEND WebKit2_SOURCES
 
     NetworkProcess/Downloads/mac/DownloadMac.mm
 
+    NetworkProcess/cache/NetworkCacheCodersCocoa.cpp
     NetworkProcess/cache/NetworkCacheDataCocoa.mm
     NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm
 
index 428b0d5..c450d85 100644 (file)
                7C9D1537184584DA009D3918 /* WKBrowsingContextGroupInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9D1536184584DA009D3918 /* WKBrowsingContextGroupInternal.h */; };
                7CA254EB182993CE00FC8A41 /* WKBrowsingContextPolicyDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CA254EA182993CE00FC8A41 /* WKBrowsingContextPolicyDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7CA3793E1AC378B30079DC37 /* _WKUserContentExtensionStorePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CA3793D1AC378B30079DC37 /* _WKUserContentExtensionStorePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               7CAB937A1D459E510070F540 /* NetworkCacheCodersCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CAB93791D459E4B0070F540 /* NetworkCacheCodersCocoa.cpp */; };
                7CB16FEF1724BA23007A0A95 /* com.apple.ist.ds.appleconnect.webplugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7CB16FE21724B9B5007A0A95 /* com.apple.ist.ds.appleconnect.webplugin.sb */; };
                7CB16FF01724BA24007A0A95 /* com.apple.QuickTime Plugin.plugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7CB16FE31724B9B5007A0A95 /* com.apple.QuickTime Plugin.plugin.sb */; };
                7CB16FF11724BA26007A0A95 /* com.apple.WebKit.plugin-common.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7CB16FE41724B9B5007A0A95 /* com.apple.WebKit.plugin-common.sb */; };
                7C9D1536184584DA009D3918 /* WKBrowsingContextGroupInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextGroupInternal.h; sourceTree = "<group>"; };
                7CA254EA182993CE00FC8A41 /* WKBrowsingContextPolicyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextPolicyDelegate.h; sourceTree = "<group>"; };
                7CA3793D1AC378B30079DC37 /* _WKUserContentExtensionStorePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKUserContentExtensionStorePrivate.h; sourceTree = "<group>"; };
+               7CAB93791D459E4B0070F540 /* NetworkCacheCodersCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheCodersCocoa.cpp; sourceTree = "<group>"; };
                7CB16FE21724B9B5007A0A95 /* com.apple.ist.ds.appleconnect.webplugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.ist.ds.appleconnect.webplugin.sb; sourceTree = "<group>"; };
                7CB16FE31724B9B5007A0A95 /* com.apple.QuickTime Plugin.plugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "com.apple.QuickTime Plugin.plugin.sb"; sourceTree = "<group>"; };
                7CB16FE41724B9B5007A0A95 /* com.apple.WebKit.plugin-common.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "com.apple.WebKit.plugin-common.sb"; sourceTree = "<group>"; };
                                E49D40D61AD3FB170066B7B9 /* NetworkCacheBlobStorage.h */,
                                E489D2831A0A2DB80078C06A /* NetworkCacheCoder.h */,
                                E489D2841A0A2DB80078C06A /* NetworkCacheCoders.cpp */,
+                               7CAB93791D459E4B0070F540 /* NetworkCacheCodersCocoa.cpp */,
                                E489D2851A0A2DB80078C06A /* NetworkCacheCoders.h */,
                                E47D1E961B062B66002676A8 /* NetworkCacheData.cpp */,
                                E42E06111AA75ABD00B11699 /* NetworkCacheData.h */,
                                BC8147D612F66D31007B2C32 /* InjectedBundleNavigationAction.cpp in Sources */,
                                BC4BEEAC120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.cpp in Sources */,
                                512935E31288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp in Sources */,
+                               7CAB937A1D459E510070F540 /* NetworkCacheCodersCocoa.cpp in Sources */,
                                CD67D30E15C08F9A00843ADF /* InjectedBundlePageDiagnosticLoggingClient.cpp in Sources */,
                                E1EE53E711F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp in Sources */,
                                BC14E109120B905E00826C0C /* InjectedBundlePageFormClient.cpp in Sources */,