WebKit Bugzilla
Attachment 356195 Details for
Bug 191648
: [Curl] Add API for ProtectionSpace.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
PATCH
191648.diff (text/plain), 14.34 KB, created by
Basuke Suzuki
on 2018-11-30 10:31:04 PST
(
hide
)
Description:
PATCH
Filename:
MIME Type:
Creator:
Basuke Suzuki
Created:
2018-11-30 10:31:04 PST
Size:
14.34 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cef83dd18a1..473fe3a7c0f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-11-29 Basuke Suzuki <basuke.suzuki@sony.com> >+ >+ [Curl] Add API for ProtectionSpace. >+ https://bugs.webkit.org/show_bug.cgi?id=191648 >+ >+ Reviewed by Alex Christensen. >+ >+ Create a platform dependent header and implementation files for ProtectionSpace. >+ >+ No new tests because there's no behavior change. >+ >+ * platform/Curl.cmake: >+ * platform/network/ProtectionSpace.h: >+ * platform/network/curl/ProtectionSpaceCurl.cpp: Added. >+ (WebCore::ProtectionSpace::certificateInfo const): >+ * platform/network/curl/ProtectionSpaceCurl.h: Added. >+ (WebCore::ProtectionSpace::ProtectionSpace): >+ (WebCore::ProtectionSpace::encodingRequiresPlatformData const): >+ (WebCore::ProtectionSpace::platformCompare): >+ > 2018-11-27 Tim Horton <timothy_horton@apple.com> > > Serialize and deserialize editable image strokes >diff --git a/Source/WebCore/platform/Curl.cmake b/Source/WebCore/platform/Curl.cmake >index ae9f6c1a8b5..f564e026707 100644 >--- a/Source/WebCore/platform/Curl.cmake >+++ b/Source/WebCore/platform/Curl.cmake >@@ -24,6 +24,7 @@ list(APPEND WebCore_SOURCES > platform/network/curl/CurlSSLVerifier.cpp > platform/network/curl/DNSResolveQueueCurl.cpp > platform/network/curl/NetworkStorageSessionCurl.cpp >+ platform/network/curl/ProtectionSpaceCurl.cpp > platform/network/curl/ProxyServerCurl.cpp > platform/network/curl/PublicSuffixCurl.cpp > platform/network/curl/ResourceErrorCurl.cpp >diff --git a/Source/WebCore/platform/network/ProtectionSpace.h b/Source/WebCore/platform/network/ProtectionSpace.h >index bcd316270f0..a5ce3bba153 100644 >--- a/Source/WebCore/platform/network/ProtectionSpace.h >+++ b/Source/WebCore/platform/network/ProtectionSpace.h >@@ -29,6 +29,8 @@ > #include "ProtectionSpaceCocoa.h" > #elif USE(CFURLCONNECTION) > #include "ProtectionSpaceCFNet.h" >+#elif USE(CURL) >+#include "ProtectionSpaceCurl.h" > #else > > #include "ProtectionSpaceBase.h" >diff --git a/Source/WebCore/platform/network/curl/ProtectionSpaceCurl.cpp b/Source/WebCore/platform/network/curl/ProtectionSpaceCurl.cpp >new file mode 100644 >index 00000000000..fd821b3cba2 >--- /dev/null >+++ b/Source/WebCore/platform/network/curl/ProtectionSpaceCurl.cpp >@@ -0,0 +1,40 @@ >+/* >+ * Copyright (C) 2017 Sony Interactive Entertainment Inc. >+ * >+ * 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 "ProtectionSpace.h" >+ >+#if USE(CURL) >+ >+namespace WebCore { >+ >+const CertificateInfo& ProtectionSpace::certificateInfo() const >+{ >+ return m_certificateInfo; >+} >+ >+} // namespace WebCore >+ >+#endif >diff --git a/Source/WebCore/platform/network/curl/ProtectionSpaceCurl.h b/Source/WebCore/platform/network/curl/ProtectionSpaceCurl.h >new file mode 100644 >index 00000000000..7130c39db2e >--- /dev/null >+++ b/Source/WebCore/platform/network/curl/ProtectionSpaceCurl.h >@@ -0,0 +1,66 @@ >+/* >+ * Copyright (C) 2018 Sony Interactive Entertainment Inc. >+ * >+ * 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. >+ */ >+ >+#pragma once >+ >+#include "CertificateInfo.h" >+#include "ProtectionSpaceBase.h" >+ >+namespace WebCore { >+ >+class ProtectionSpace : public ProtectionSpaceBase { >+public: >+ ProtectionSpace() >+ : ProtectionSpaceBase() >+ { >+ } >+ >+ ProtectionSpace(const String& host, int port, ProtectionSpaceServerType serverType, const String& realm, ProtectionSpaceAuthenticationScheme authenticationScheme) >+ : ProtectionSpaceBase(host, port, serverType, realm, authenticationScheme) >+ { >+ } >+ >+ ProtectionSpace(const String& host, int port, ProtectionSpaceServerType serverType, const String& realm, ProtectionSpaceAuthenticationScheme authenticationScheme, const CertificateInfo& certificateInfo) >+ : ProtectionSpaceBase(host, port, serverType, realm, authenticationScheme) >+ , m_certificateInfo(certificateInfo) >+ { >+ } >+ >+ ProtectionSpace(WTF::HashTableDeletedValueType deletedValue) >+ : ProtectionSpaceBase(deletedValue) >+ { >+ } >+ >+ bool encodingRequiresPlatformData() const { return true; } >+ static bool platformCompare(const ProtectionSpace& a, const ProtectionSpace& b) { return a.m_certificateInfo == b.m_certificateInfo; } >+ >+ WEBCORE_EXPORT const CertificateInfo& certificateInfo() const; >+ >+private: >+ >+ CertificateInfo m_certificateInfo; >+}; >+ >+} // namespace WebCore >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 7bb47cf69f1..a29f4952854 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-11-29 Basuke Suzuki <basuke.suzuki@sony.com> >+ >+ [Curl] Add API for ProtectionSpace. >+ https://bugs.webkit.org/show_bug.cgi?id=191648 >+ >+ Reviewed by Alex Christensen. >+ >+ Added API to get certificate information from protection space. >+ >+ * PlatformWin.cmake: >+ * Shared/curl/WebCoreArgumentCodersCurl.cpp: >+ (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): >+ (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): >+ * UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp: Added. >+ (WKProtectionSpaceCopyCertificateInfo): >+ * UIProcess/API/C/curl/WKProtectionSpaceCurl.h: Added. >+ > 2018-11-27 Alexey Proskuryakov <ap@apple.com> > > Modernize the check for async _saveCookies existence >diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake >index e32d6ae3cd9..2aa35ad4835 100644 >--- a/Source/WebKit/PlatformWin.cmake >+++ b/Source/WebKit/PlatformWin.cmake >@@ -42,6 +42,7 @@ list(APPEND WebKit_SOURCES > > UIProcess/API/C/WKViewportAttributes.cpp > >+ UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp > UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp > > UIProcess/API/C/win/WKView.cpp >diff --git a/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp b/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp >index 89e79eb0654..9de3978d66a 100644 >--- a/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp >+++ b/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp >@@ -29,6 +29,7 @@ > #include "DataReference.h" > #include <WebCore/CertificateInfo.h> > #include <WebCore/CurlProxySettings.h> >+#include <WebCore/ProtectionSpace.h> > #include <WebCore/ResourceError.h> > #include <WebCore/ResourceRequest.h> > #include <WebCore/ResourceResponse.h> >@@ -130,15 +131,42 @@ bool ArgumentCoder<ResourceError>::decodePlatformData(Decoder& decoder, Resource > return true; > } > >-void ArgumentCoder<ProtectionSpace>::encodePlatformData(Encoder&, const ProtectionSpace&) >+void ArgumentCoder<ProtectionSpace>::encodePlatformData(Encoder& encoder, const ProtectionSpace& space) > { >- ASSERT_NOT_REACHED(); >+ encoder << space.host() << space.port() << space.realm(); >+ encoder.encodeEnum(space.authenticationScheme()); >+ encoder.encodeEnum(space.serverType()); >+ encoder << space.certificateInfo(); > } > >-bool ArgumentCoder<ProtectionSpace>::decodePlatformData(Decoder&, ProtectionSpace&) >+bool ArgumentCoder<ProtectionSpace>::decodePlatformData(Decoder& decoder, ProtectionSpace& space) > { >- ASSERT_NOT_REACHED(); >- return false; >+ String host; >+ if (!decoder.decode(host)) >+ return false; >+ >+ int port; >+ if (!decoder.decode(port)) >+ return false; >+ >+ String realm; >+ if (!decoder.decode(realm)) >+ return false; >+ >+ ProtectionSpaceAuthenticationScheme authenticationScheme; >+ if (!decoder.decodeEnum(authenticationScheme)) >+ return false; >+ >+ ProtectionSpaceServerType serverType; >+ if (!decoder.decodeEnum(serverType)) >+ return false; >+ >+ CertificateInfo certificateInfo; >+ if (!decoder.decode(certificateInfo)) >+ return false; >+ >+ space = ProtectionSpace(host, port, serverType, realm, authenticationScheme, certificateInfo); >+ return true; > } > > void ArgumentCoder<Credential>::encodePlatformData(Encoder&, const Credential&) >diff --git a/Source/WebKit/UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp b/Source/WebKit/UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp >new file mode 100644 >index 00000000000..53ed0ee39f2 >--- /dev/null >+++ b/Source/WebKit/UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp >@@ -0,0 +1,40 @@ >+/* >+ * Copyright (C) 2018 Sony Interactive Entertainment Inc. >+ * >+ * 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 "WKProtectionSpaceCurl.h" >+ >+#include "WKAPICast.h" >+#include "WebCertificateInfo.h" >+#include "WebCredential.h" >+#include "WebProtectionSpace.h" >+ >+using namespace WebKit; >+ >+WKCertificateInfoRef WKProtectionSpaceCopyCertificateInfo(WKProtectionSpaceRef protectionSpaceRef) >+{ >+ RefPtr<WebCertificateInfo> certificateInfo = WebCertificateInfo::create(toImpl(protectionSpaceRef)->protectionSpace().certificateInfo()); >+ return toAPI(certificateInfo.leakRef()); >+} >diff --git a/Source/WebKit/UIProcess/API/C/curl/WKProtectionSpaceCurl.h b/Source/WebKit/UIProcess/API/C/curl/WKProtectionSpaceCurl.h >new file mode 100644 >index 00000000000..4c0ebea6dbe >--- /dev/null >+++ b/Source/WebKit/UIProcess/API/C/curl/WKProtectionSpaceCurl.h >@@ -0,0 +1,38 @@ >+/* >+ * Copyright (C) 2018 Sony Interactive Entertainment Inc. >+ * >+ * 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. >+ */ >+ >+#pragma once >+ >+#include <WebKit/WKBase.h> >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+WK_EXPORT WKCertificateInfoRef WKProtectionSpaceCopyCertificateInfo(WKProtectionSpaceRef); >+ >+#ifdef __cplusplus >+} >+#endif
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191648
:
356046
| 356195