Diff
Modified: trunk/Source/WebCore/ChangeLog (287223 => 287224)
--- trunk/Source/WebCore/ChangeLog 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/ChangeLog 2021-12-18 17:46:14 UTC (rev 287224)
@@ -1,3 +1,63 @@
+2021-12-18 Chris Dumez <[email protected]>
+
+ Convert ProtectionSpace enums into enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=234455
+
+ Reviewed by Alex Christensen.
+
+ * platform/network/CredentialStorage.cpp:
+ (WebCore::CredentialStorage::set):
+ (WebCore::CredentialStorage::removeCredentialsWithOrigin):
+ (WebCore::CredentialStorage::originsWithCredentials const):
+ * platform/network/ProtectionSpace.h:
+ (WebCore::ProtectionSpace::ProtectionSpace):
+ * platform/network/ProtectionSpaceBase.cpp:
+ (WebCore::ProtectionSpaceBase::ProtectionSpaceBase):
+ (WebCore::ProtectionSpaceBase::isProxy const):
+ (WebCore::ProtectionSpaceBase::receivesCredentialSecurely const):
+ (WebCore::ProtectionSpaceBase::isPasswordBased const):
+ * platform/network/ProtectionSpaceBase.h:
+ (WebCore::ProtectionSpaceBase::serverType const):
+ (WebCore::ProtectionSpaceBase::authenticationScheme const):
+ * platform/network/cf/AuthenticationCF.cpp:
+ (WebCore::createCF):
+ (WebCore::core):
+ * platform/network/cf/ProtectionSpaceCFNet.h:
+ (WebCore::ProtectionSpace::ProtectionSpace):
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::ResourceHandle::receivedCredential):
+ * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
+ (WebCore::authenticationSchemeFromAuthenticationMethod):
+ * platform/network/cocoa/ProtectionSpaceCocoa.h:
+ (WebCore::ProtectionSpace::ProtectionSpace):
+ * platform/network/cocoa/ProtectionSpaceCocoa.mm:
+ (WebCore::type):
+ (WebCore::scheme):
+ (WebCore::ProtectionSpace::nsSpace const):
+ * platform/network/curl/AuthenticationChallenge.h:
+ * platform/network/curl/AuthenticationChallengeCurl.cpp:
+ (WebCore::AuthenticationChallenge::protectionSpaceServerTypeFromURI):
+ (WebCore::AuthenticationChallenge::protectionSpaceForServerTrust):
+ (WebCore::AuthenticationChallenge::authenticationSchemeFromCurlAuth):
+ * platform/network/curl/CurlRequest.cpp:
+ (WebCore::CurlRequest::setAuthenticationScheme):
+ * platform/network/curl/CurlRequest.h:
+ * platform/network/curl/ProtectionSpaceCurl.h:
+ (WebCore::ProtectionSpace::ProtectionSpace):
+ * platform/network/curl/ResourceHandleCurl.cpp:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::platformLoadResourceSynchronously):
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::receivedCredential):
+ * platform/network/soup/AuthenticationChallengeSoup.cpp:
+ (WebCore::protectionSpaceServerTypeFromURL):
+ (WebCore::protectionSpaceFromSoupAuthAndURL):
+ (WebCore::protectionSpaceForClientCertificate):
+ (WebCore::protectionSpaceForClientCertificatePassword):
+ * platform/network/soup/NetworkStorageSessionSoup.cpp:
+ (WebCore::schemeFromProtectionSpaceServerType):
+ (WebCore::authTypeFromProtectionSpaceAuthenticationScheme):
+
2021-12-18 Antti Koivisto <[email protected]>
Remove unused :-internal-direct-focus pseudo-class
Modified: trunk/Source/WebCore/platform/network/CredentialStorage.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/CredentialStorage.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/CredentialStorage.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -60,16 +60,16 @@
void CredentialStorage::set(const String& partitionName, const Credential& credential, const ProtectionSpace& protectionSpace, const URL& url)
{
- ASSERT(protectionSpace.isProxy() || protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested || url.protocolIsInHTTPFamily());
- ASSERT(protectionSpace.isProxy() || protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested || url.isValid());
+ ASSERT(protectionSpace.isProxy() || protectionSpace.authenticationScheme() == ProtectionSpace::AuthenticationScheme::ClientCertificateRequested || url.protocolIsInHTTPFamily());
+ ASSERT(protectionSpace.isProxy() || protectionSpace.authenticationScheme() == ProtectionSpace::AuthenticationScheme::ClientCertificateRequested || url.isValid());
m_protectionSpaceToCredentialMap.set(std::make_pair(partitionName, protectionSpace), credential);
- if (!protectionSpace.isProxy() && protectionSpace.authenticationScheme() != ProtectionSpaceAuthenticationSchemeClientCertificateRequested) {
+ if (!protectionSpace.isProxy() && protectionSpace.authenticationScheme() != ProtectionSpace::AuthenticationScheme::ClientCertificateRequested) {
m_originsWithCredentials.add(originStringFromURL(url));
- ProtectionSpaceAuthenticationScheme scheme = protectionSpace.authenticationScheme();
- if (scheme == ProtectionSpaceAuthenticationSchemeHTTPBasic || scheme == ProtectionSpaceAuthenticationSchemeDefault) {
+ auto scheme = protectionSpace.authenticationScheme();
+ if (scheme == ProtectionSpace::AuthenticationScheme::HTTPBasic || scheme == ProtectionSpace::AuthenticationScheme::Default) {
// The map can contain both a path and its subpath - while redundant, this makes lookups faster.
m_pathToDefaultProtectionSpaceMap.set(protectionSpaceMapKeyFromURL(url), protectionSpace);
}
@@ -94,8 +94,8 @@
if (protectionSpace.host() == origin.host
&& ((origin.port && protectionSpace.port() == *origin.port)
|| (!origin.port && protectionSpace.port() == 80))
- && ((protectionSpace.serverType() == ProtectionSpaceServerHTTP && origin.protocol == "http"_s)
- || (protectionSpace.serverType() == ProtectionSpaceServerHTTPS && origin.protocol == "https"_s)))
+ && ((protectionSpace.serverType() == ProtectionSpace::ServerType::HTTP && origin.protocol == "http"_s)
+ || (protectionSpace.serverType() == ProtectionSpace::ServerType::HTTPS && origin.protocol == "https"_s)))
keysToRemove.append(keyValuePair.key);
}
for (auto& key : keysToRemove)
@@ -111,16 +111,16 @@
continue;
String protocol;
switch (protectionSpace.serverType()) {
- case ProtectionSpaceServerHTTP:
+ case ProtectionSpace::ServerType::HTTP:
protocol = "http"_s;
break;
- case ProtectionSpaceServerHTTPS:
+ case ProtectionSpace::ServerType::HTTPS:
protocol = "https"_s;
break;
- case ProtectionSpaceServerFTP:
+ case ProtectionSpace::ServerType::FTP:
protocol = "ftp"_s;
break;
- case ProtectionSpaceServerFTPS:
+ case ProtectionSpace::ServerType::FTPS:
protocol = "ftps"_s;
break;
default:
Modified: trunk/Source/WebCore/platform/network/ProtectionSpace.h (287223 => 287224)
--- trunk/Source/WebCore/platform/network/ProtectionSpace.h 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/ProtectionSpace.h 2021-12-18 17:46:14 UTC (rev 287224)
@@ -40,7 +40,7 @@
class ProtectionSpace : public ProtectionSpaceBase {
public:
ProtectionSpace() : ProtectionSpaceBase() { }
- ProtectionSpace(const String& host, int port, ProtectionSpaceServerType serverType, const String& realm, ProtectionSpaceAuthenticationScheme authenticationScheme)
+ ProtectionSpace(const String& host, int port, ServerType serverType, const String& realm, AuthenticationScheme authenticationScheme)
: ProtectionSpaceBase(host, port, serverType, realm, authenticationScheme)
{
}
Modified: trunk/Source/WebCore/platform/network/ProtectionSpaceBase.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/ProtectionSpaceBase.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/ProtectionSpaceBase.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -36,7 +36,7 @@
// Need to enforce empty, non-null strings due to the pickiness of the String == String operator
// combined with the semantics of the String(NSString*) constructor
-ProtectionSpaceBase::ProtectionSpaceBase(const String& host, int port, ProtectionSpaceServerType serverType, const String& realm, ProtectionSpaceAuthenticationScheme authenticationScheme)
+ProtectionSpaceBase::ProtectionSpaceBase(const String& host, int port, ServerType serverType, const String& realm, AuthenticationScheme authenticationScheme)
: m_host(host.length() ? host : emptyString())
, m_realm(realm.length() ? realm : emptyString())
, m_port(port)
@@ -47,37 +47,37 @@
bool ProtectionSpaceBase::isProxy() const
{
- return (m_serverType == ProtectionSpaceProxyHTTP ||
- m_serverType == ProtectionSpaceProxyHTTPS ||
- m_serverType == ProtectionSpaceProxyFTP ||
- m_serverType == ProtectionSpaceProxySOCKS);
+ return m_serverType == ServerType::ProxyHTTP
+ || m_serverType == ServerType::ProxyHTTPS
+ || m_serverType == ServerType::ProxyFTP
+ || m_serverType == ServerType::ProxySOCKS;
}
bool ProtectionSpaceBase::receivesCredentialSecurely() const
{
- return (m_serverType == ProtectionSpaceServerHTTPS ||
- m_serverType == ProtectionSpaceServerFTPS ||
- m_serverType == ProtectionSpaceProxyHTTPS ||
- m_authenticationScheme == ProtectionSpaceAuthenticationSchemeHTTPDigest);
+ return m_serverType == ServerType::HTTPS
+ || m_serverType == ServerType::FTPS
+ || m_serverType == ServerType::ProxyHTTPS
+ || m_authenticationScheme == AuthenticationScheme::HTTPDigest;
}
bool ProtectionSpaceBase::isPasswordBased() const
{
switch (m_authenticationScheme) {
- case ProtectionSpaceAuthenticationSchemeDefault:
- case ProtectionSpaceAuthenticationSchemeHTTPBasic:
- case ProtectionSpaceAuthenticationSchemeHTTPDigest:
- case ProtectionSpaceAuthenticationSchemeHTMLForm:
- case ProtectionSpaceAuthenticationSchemeNTLM:
- case ProtectionSpaceAuthenticationSchemeNegotiate:
- case ProtectionSpaceAuthenticationSchemeOAuth:
+ case AuthenticationScheme::Default:
+ case AuthenticationScheme::HTTPBasic:
+ case AuthenticationScheme::HTTPDigest:
+ case AuthenticationScheme::HTMLForm:
+ case AuthenticationScheme::NTLM:
+ case AuthenticationScheme::Negotiate:
+ case AuthenticationScheme::OAuth:
#if USE(GLIB)
- case ProtectionSpaceAuthenticationSchemeClientCertificatePINRequested:
+ case AuthenticationScheme::ClientCertificatePINRequested:
#endif
return true;
- case ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
- case ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
- case ProtectionSpaceAuthenticationSchemeUnknown:
+ case AuthenticationScheme::ClientCertificateRequested:
+ case AuthenticationScheme::ServerTrustEvaluationRequested:
+ case AuthenticationScheme::Unknown:
return false;
}
Modified: trunk/Source/WebCore/platform/network/ProtectionSpaceBase.h (287223 => 287224)
--- trunk/Source/WebCore/platform/network/ProtectionSpaceBase.h 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/ProtectionSpaceBase.h 2021-12-18 17:46:14 UTC (rev 287224)
@@ -31,45 +31,44 @@
namespace WebCore {
class ProtectionSpace;
+
+class ProtectionSpaceBase {
+public:
+ enum class ServerType : uint8_t {
+ HTTP = 1,
+ HTTPS = 2,
+ FTP = 3,
+ FTPS = 4,
+ ProxyHTTP = 5,
+ ProxyHTTPS = 6,
+ ProxyFTP = 7,
+ ProxySOCKS = 8
+ };
-enum ProtectionSpaceServerType {
- ProtectionSpaceServerHTTP = 1,
- ProtectionSpaceServerHTTPS = 2,
- ProtectionSpaceServerFTP = 3,
- ProtectionSpaceServerFTPS = 4,
- ProtectionSpaceProxyHTTP = 5,
- ProtectionSpaceProxyHTTPS = 6,
- ProtectionSpaceProxyFTP = 7,
- ProtectionSpaceProxySOCKS = 8
-};
-
-enum ProtectionSpaceAuthenticationScheme {
- ProtectionSpaceAuthenticationSchemeDefault = 1,
- ProtectionSpaceAuthenticationSchemeHTTPBasic = 2,
- ProtectionSpaceAuthenticationSchemeHTTPDigest = 3,
- ProtectionSpaceAuthenticationSchemeHTMLForm = 4,
- ProtectionSpaceAuthenticationSchemeNTLM = 5,
- ProtectionSpaceAuthenticationSchemeNegotiate = 6,
- ProtectionSpaceAuthenticationSchemeClientCertificateRequested = 7,
- ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested = 8,
- ProtectionSpaceAuthenticationSchemeOAuth = 9,
+ enum class AuthenticationScheme : uint8_t {
+ Default = 1,
+ HTTPBasic = 2,
+ HTTPDigest = 3,
+ HTMLForm = 4,
+ NTLM = 5,
+ Negotiate = 6,
+ ClientCertificateRequested = 7,
+ ServerTrustEvaluationRequested = 8,
+ OAuth = 9,
#if USE(GLIB)
- ProtectionSpaceAuthenticationSchemeClientCertificatePINRequested = 10,
+ ClientCertificatePINRequested = 10,
#endif
- ProtectionSpaceAuthenticationSchemeUnknown = 100
-};
-
-class ProtectionSpaceBase {
+ Unknown = 100
+ };
-public:
bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; }
const String& host() const { return m_host; }
int port() const { return m_port; }
- ProtectionSpaceServerType serverType() const { return m_serverType; }
+ ServerType serverType() const { return m_serverType; }
WEBCORE_EXPORT bool isProxy() const;
const String& realm() const { return m_realm; }
- ProtectionSpaceAuthenticationScheme authenticationScheme() const { return m_authenticationScheme; }
+ AuthenticationScheme authenticationScheme() const { return m_authenticationScheme; }
WEBCORE_EXPORT bool receivesCredentialSecurely() const;
WEBCORE_EXPORT bool isPasswordBased() const;
@@ -80,7 +79,7 @@
protected:
ProtectionSpaceBase() = default;
- WEBCORE_EXPORT ProtectionSpaceBase(const String& host, int port, ProtectionSpaceServerType, const String& realm, ProtectionSpaceAuthenticationScheme);
+ WEBCORE_EXPORT ProtectionSpaceBase(const String& host, int port, ServerType, const String& realm, AuthenticationScheme);
// Hash table deleted values, which are only constructed and never copied or destroyed.
ProtectionSpaceBase(WTF::HashTableDeletedValueType) : m_isHashTableDeletedValue(true) { }
@@ -94,8 +93,8 @@
String m_realm { emptyString() };
int m_port { 0 };
- ProtectionSpaceServerType m_serverType { ProtectionSpaceServerHTTP };
- ProtectionSpaceAuthenticationScheme m_authenticationScheme { ProtectionSpaceAuthenticationSchemeDefault };
+ ServerType m_serverType { ServerType::HTTP };
+ AuthenticationScheme m_authenticationScheme { AuthenticationScheme::Default };
bool m_isHashTableDeletedValue { false };
};
@@ -106,33 +105,33 @@
namespace WTF {
-template<> struct EnumTraits<WebCore::ProtectionSpaceAuthenticationScheme> {
+template<> struct EnumTraits<WebCore::ProtectionSpaceBase::AuthenticationScheme> {
using values = EnumValues<
- WebCore::ProtectionSpaceAuthenticationScheme,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeDefault,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeHTTPBasic,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeHTTPDigest,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeHTMLForm,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeNTLM,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeNegotiate,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeClientCertificateRequested,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeOAuth,
- WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeUnknown
+ WebCore::ProtectionSpaceBase::AuthenticationScheme,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::Default,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::HTTPBasic,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::HTTPDigest,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::HTMLForm,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::NTLM,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::Negotiate,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::ClientCertificateRequested,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::ServerTrustEvaluationRequested,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::OAuth,
+ WebCore::ProtectionSpaceBase::AuthenticationScheme::Unknown
>;
};
-template<> struct EnumTraits<WebCore::ProtectionSpaceServerType> {
+template<> struct EnumTraits<WebCore::ProtectionSpaceBase::ServerType> {
using values = EnumValues<
- WebCore::ProtectionSpaceServerType,
- WebCore::ProtectionSpaceServerType::ProtectionSpaceServerHTTP,
- WebCore::ProtectionSpaceServerType::ProtectionSpaceServerHTTPS,
- WebCore::ProtectionSpaceServerType::ProtectionSpaceServerFTP,
- WebCore::ProtectionSpaceServerType::ProtectionSpaceServerFTPS,
- WebCore::ProtectionSpaceServerType::ProtectionSpaceProxyHTTP,
- WebCore::ProtectionSpaceServerType::ProtectionSpaceProxyHTTPS,
- WebCore::ProtectionSpaceServerType::ProtectionSpaceProxyFTP,
- WebCore::ProtectionSpaceServerType::ProtectionSpaceProxySOCKS
+ WebCore::ProtectionSpaceBase::ServerType,
+ WebCore::ProtectionSpaceBase::ServerType::HTTP,
+ WebCore::ProtectionSpaceBase::ServerType::HTTPS,
+ WebCore::ProtectionSpaceBase::ServerType::FTP,
+ WebCore::ProtectionSpaceBase::ServerType::FTPS,
+ WebCore::ProtectionSpaceBase::ServerType::ProxyHTTP,
+ WebCore::ProtectionSpaceBase::ServerType::ProxyHTTPS,
+ WebCore::ProtectionSpaceBase::ServerType::ProxyFTP,
+ WebCore::ProtectionSpaceBase::ServerType::ProxySOCKS
>;
};
Modified: trunk/Source/WebCore/platform/network/cf/AuthenticationCF.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/cf/AuthenticationCF.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/cf/AuthenticationCF.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -104,28 +104,28 @@
{
CFURLProtectionSpaceServerType serverType = kCFURLProtectionSpaceServerHTTP;
switch (coreSpace.serverType()) {
- case ProtectionSpaceServerHTTP:
+ case ProtectionSpace::ServerType::HTTP:
serverType = kCFURLProtectionSpaceServerHTTP;
break;
- case ProtectionSpaceServerHTTPS:
+ case ProtectionSpace::ServerType::HTTPS:
serverType = kCFURLProtectionSpaceServerHTTPS;
break;
- case ProtectionSpaceServerFTP:
+ case ProtectionSpace::ServerType::FTP:
serverType = kCFURLProtectionSpaceServerFTP;
break;
- case ProtectionSpaceServerFTPS:
+ case ProtectionSpace::ServerType::FTPS:
serverType = kCFURLProtectionSpaceServerFTPS;
break;
- case ProtectionSpaceProxyHTTP:
+ case ProtectionSpace::ServerType::ProxyHTTP:
serverType = kCFURLProtectionSpaceProxyHTTP;
break;
- case ProtectionSpaceProxyHTTPS:
+ case ProtectionSpace::ServerType::ProxyHTTPS:
serverType = kCFURLProtectionSpaceProxyHTTPS;
break;
- case ProtectionSpaceProxyFTP:
+ case ProtectionSpace::ServerType::ProxyFTP:
serverType = kCFURLProtectionSpaceProxyFTP;
break;
- case ProtectionSpaceProxySOCKS:
+ case ProtectionSpace::ServerType::ProxySOCKS:
serverType = kCFURLProtectionSpaceProxySOCKS;
break;
default:
@@ -134,29 +134,29 @@
CFURLProtectionSpaceAuthenticationScheme scheme = kCFURLProtectionSpaceAuthenticationSchemeDefault;
switch (coreSpace.authenticationScheme()) {
- case ProtectionSpaceAuthenticationSchemeDefault:
+ case ProtectionSpace::AuthenticationScheme::Default:
scheme = kCFURLProtectionSpaceAuthenticationSchemeDefault;
break;
- case ProtectionSpaceAuthenticationSchemeHTTPBasic:
+ case ProtectionSpace::AuthenticationScheme::HTTPBasic:
scheme = kCFURLProtectionSpaceAuthenticationSchemeHTTPBasic;
break;
- case ProtectionSpaceAuthenticationSchemeHTTPDigest:
+ case ProtectionSpace::AuthenticationScheme::HTTPDigest:
scheme = kCFURLProtectionSpaceAuthenticationSchemeHTTPDigest;
break;
- case ProtectionSpaceAuthenticationSchemeHTMLForm:
+ case ProtectionSpace::AuthenticationScheme::HTMLForm:
scheme = kCFURLProtectionSpaceAuthenticationSchemeHTMLForm;
break;
- case ProtectionSpaceAuthenticationSchemeNTLM:
+ case ProtectionSpace::AuthenticationScheme::NTLM:
scheme = kCFURLProtectionSpaceAuthenticationSchemeNTLM;
break;
- case ProtectionSpaceAuthenticationSchemeNegotiate:
+ case ProtectionSpace::AuthenticationScheme::Negotiate:
scheme = kCFURLProtectionSpaceAuthenticationSchemeNegotiate;
break;
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
- case ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
+ case ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested:
scheme = kCFURLProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
break;
- case ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
+ case ProtectionSpace::AuthenticationScheme::ClientCertificateRequested:
scheme = kCFURLProtectionSpaceAuthenticationSchemeClientCertificateRequested;
break;
#endif
@@ -192,67 +192,67 @@
ProtectionSpace core(CFURLProtectionSpaceRef cfSpace)
{
- ProtectionSpaceServerType serverType = ProtectionSpaceServerHTTP;
+ auto serverType = ProtectionSpace::ServerType::HTTP;
switch (CFURLProtectionSpaceGetServerType(cfSpace)) {
case kCFURLProtectionSpaceServerHTTP:
break;
case kCFURLProtectionSpaceServerHTTPS:
- serverType = ProtectionSpaceServerHTTPS;
+ serverType = ProtectionSpace::ServerType::HTTPS;
break;
case kCFURLProtectionSpaceServerFTP:
- serverType = ProtectionSpaceServerFTP;
+ serverType = ProtectionSpace::ServerType::FTP;
break;
case kCFURLProtectionSpaceServerFTPS:
- serverType = ProtectionSpaceServerFTPS;
+ serverType = ProtectionSpace::ServerType::FTPS;
break;
case kCFURLProtectionSpaceProxyHTTP:
- serverType = ProtectionSpaceProxyHTTP;
+ serverType = ProtectionSpace::ServerType::ProxyHTTP;
break;
case kCFURLProtectionSpaceProxyHTTPS:
- serverType = ProtectionSpaceProxyHTTPS;
+ serverType = ProtectionSpace::ServerType::ProxyHTTPS;
break;
case kCFURLProtectionSpaceProxyFTP:
- serverType = ProtectionSpaceProxyFTP;
+ serverType = ProtectionSpace::ServerType::ProxyFTP;
break;
case kCFURLProtectionSpaceProxySOCKS:
- serverType = ProtectionSpaceProxySOCKS;
+ serverType = ProtectionSpace::ServerType::ProxySOCKS;
break;
default:
ASSERT_NOT_REACHED();
}
- ProtectionSpaceAuthenticationScheme scheme = ProtectionSpaceAuthenticationSchemeDefault;
+ auto scheme = ProtectionSpace::AuthenticationScheme::Default;
switch (CFURLProtectionSpaceGetAuthenticationScheme(cfSpace)) {
case kCFURLProtectionSpaceAuthenticationSchemeDefault:
- scheme = ProtectionSpaceAuthenticationSchemeDefault;
+ scheme = ProtectionSpace::AuthenticationScheme::Default;
break;
case kCFURLProtectionSpaceAuthenticationSchemeHTTPBasic:
- scheme = ProtectionSpaceAuthenticationSchemeHTTPBasic;
+ scheme = ProtectionSpace::AuthenticationScheme::HTTPBasic;
break;
case kCFURLProtectionSpaceAuthenticationSchemeHTTPDigest:
- scheme = ProtectionSpaceAuthenticationSchemeHTTPDigest;
+ scheme = ProtectionSpace::AuthenticationScheme::HTTPDigest;
break;
case kCFURLProtectionSpaceAuthenticationSchemeHTMLForm:
- scheme = ProtectionSpaceAuthenticationSchemeHTMLForm;
+ scheme = ProtectionSpace::AuthenticationScheme::HTMLForm;
break;
case kCFURLProtectionSpaceAuthenticationSchemeNTLM:
- scheme = ProtectionSpaceAuthenticationSchemeNTLM;
+ scheme = ProtectionSpace::AuthenticationScheme::NTLM;
break;
case kCFURLProtectionSpaceAuthenticationSchemeNegotiate:
- scheme = ProtectionSpaceAuthenticationSchemeNegotiate;
+ scheme = ProtectionSpace::AuthenticationScheme::Negotiate;
break;
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
case kCFURLProtectionSpaceAuthenticationSchemeClientCertificateRequested:
- scheme = ProtectionSpaceAuthenticationSchemeClientCertificateRequested;
+ scheme = ProtectionSpace::AuthenticationScheme::ClientCertificateRequested;
break;
case kCFURLProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
- scheme = ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
+ scheme = ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested;
break;
#endif
default:
- scheme = ProtectionSpaceAuthenticationSchemeUnknown;
+ scheme = ProtectionSpace::AuthenticationScheme::Unknown;
ASSERT_NOT_REACHED();
}
Modified: trunk/Source/WebCore/platform/network/cf/ProtectionSpaceCFNet.h (287223 => 287224)
--- trunk/Source/WebCore/platform/network/cf/ProtectionSpaceCFNet.h 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/cf/ProtectionSpaceCFNet.h 2021-12-18 17:46:14 UTC (rev 287224)
@@ -36,7 +36,7 @@
class ProtectionSpace : public ProtectionSpaceBase {
public:
ProtectionSpace() : ProtectionSpaceBase() { }
- ProtectionSpace(const String& host, int port, ProtectionSpaceServerType serverType, const String& realm, ProtectionSpaceAuthenticationScheme authenticationScheme)
+ ProtectionSpace(const String& host, int port, ServerType serverType, const String& realm, AuthenticationScheme authenticationScheme)
: ProtectionSpaceBase(host, port, serverType, realm, authenticationScheme)
{
}
Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -425,7 +425,7 @@
return;
}
- if (credential.persistence() == CredentialPersistenceForSession && challenge.protectionSpace().authenticationScheme() != ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
+ if (credential.persistence() == CredentialPersistenceForSession && challenge.protectionSpace().authenticationScheme() != ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested) {
// Manage per-session credentials internally, because once NSURLCredentialPersistencePerSession is used, there is no way
// to ignore it for a particular request (short of removing it altogether).
Credential webCredential(credential, CredentialPersistenceNone);
Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -399,18 +399,18 @@
return true;
}
-static ProtectionSpaceAuthenticationScheme authenticationSchemeFromAuthenticationMethod(CFStringRef method)
+static ProtectionSpace::AuthenticationScheme authenticationSchemeFromAuthenticationMethod(CFStringRef method)
{
if (CFEqual(method, kCFHTTPAuthenticationSchemeBasic))
- return ProtectionSpaceAuthenticationSchemeHTTPBasic;
+ return ProtectionSpace::AuthenticationScheme::HTTPBasic;
if (CFEqual(method, kCFHTTPAuthenticationSchemeDigest))
- return ProtectionSpaceAuthenticationSchemeHTTPDigest;
+ return ProtectionSpace::AuthenticationScheme::HTTPDigest;
if (CFEqual(method, kCFHTTPAuthenticationSchemeNTLM))
- return ProtectionSpaceAuthenticationSchemeNTLM;
+ return ProtectionSpace::AuthenticationScheme::NTLM;
if (CFEqual(method, kCFHTTPAuthenticationSchemeNegotiate))
- return ProtectionSpaceAuthenticationSchemeNegotiate;
+ return ProtectionSpace::AuthenticationScheme::Negotiate;
ASSERT_NOT_REACHED();
- return ProtectionSpaceAuthenticationSchemeUnknown;
+ return ProtectionSpace::AuthenticationScheme::Unknown;
}
static void setCONNECTProxyAuthorizationForStream(CFReadStreamRef stream, CFStringRef proxyAuthorizationString)
@@ -447,7 +447,7 @@
return;
}
- ProtectionSpace protectionSpace(String(m_proxyHost.get()), port, ProtectionSpaceProxyHTTPS, String(realmCF.get()), authenticationSchemeFromAuthenticationMethod(methodCF.get()));
+ ProtectionSpace protectionSpace(String(m_proxyHost.get()), port, ProtectionSpace::ServerType::ProxyHTTPS, String(realmCF.get()), authenticationSchemeFromAuthenticationMethod(methodCF.get()));
String login;
String password;
if (!m_sentStoredCredentials && getStoredCONNECTProxyCredentials(protectionSpace, login, password)) {
Modified: trunk/Source/WebCore/platform/network/cocoa/ProtectionSpaceCocoa.h (287223 => 287224)
--- trunk/Source/WebCore/platform/network/cocoa/ProtectionSpaceCocoa.h 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/cocoa/ProtectionSpaceCocoa.h 2021-12-18 17:46:14 UTC (rev 287224)
@@ -39,7 +39,7 @@
class ProtectionSpace : public ProtectionSpaceBase {
public:
ProtectionSpace() : ProtectionSpaceBase() { }
- ProtectionSpace(const String& host, int port, ProtectionSpaceServerType serverType, const String& realm, ProtectionSpaceAuthenticationScheme authenticationScheme)
+ ProtectionSpace(const String& host, int port, ServerType serverType, const String& realm, AuthenticationScheme authenticationScheme)
: ProtectionSpaceBase(host, port, serverType, realm, authenticationScheme)
{
}
Modified: trunk/Source/WebCore/platform/network/cocoa/ProtectionSpaceCocoa.mm (287223 => 287224)
--- trunk/Source/WebCore/platform/network/cocoa/ProtectionSpaceCocoa.mm 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/cocoa/ProtectionSpaceCocoa.mm 2021-12-18 17:46:14 UTC (rev 287224)
@@ -30,63 +30,63 @@
namespace WebCore {
-static ProtectionSpaceServerType type(NSURLProtectionSpace *space)
+static ProtectionSpace::ServerType type(NSURLProtectionSpace *space)
{
if ([space isProxy]) {
NSString *proxyType = space.proxyType;
if ([proxyType isEqualToString:NSURLProtectionSpaceHTTPProxy])
- return ProtectionSpaceProxyHTTP;
+ return ProtectionSpace::ServerType::ProxyHTTP;
if ([proxyType isEqualToString:NSURLProtectionSpaceHTTPSProxy])
- return ProtectionSpaceProxyHTTPS;
+ return ProtectionSpace::ServerType::ProxyHTTPS;
if ([proxyType isEqualToString:NSURLProtectionSpaceFTPProxy])
- return ProtectionSpaceProxyFTP;
+ return ProtectionSpace::ServerType::ProxyFTP;
if ([proxyType isEqualToString:NSURLProtectionSpaceSOCKSProxy])
- return ProtectionSpaceProxySOCKS;
+ return ProtectionSpace::ServerType::ProxySOCKS;
ASSERT_NOT_REACHED();
- return ProtectionSpaceProxyHTTP;
+ return ProtectionSpace::ServerType::ProxyHTTP;
}
NSString *protocol = space.protocol;
if ([protocol caseInsensitiveCompare:@"http"] == NSOrderedSame)
- return ProtectionSpaceServerHTTP;
+ return ProtectionSpace::ServerType::HTTP;
if ([protocol caseInsensitiveCompare:@"https"] == NSOrderedSame)
- return ProtectionSpaceServerHTTPS;
+ return ProtectionSpace::ServerType::HTTPS;
if ([protocol caseInsensitiveCompare:@"ftp"] == NSOrderedSame)
- return ProtectionSpaceServerFTP;
+ return ProtectionSpace::ServerType::FTP;
if ([protocol caseInsensitiveCompare:@"ftps"] == NSOrderedSame)
- return ProtectionSpaceServerFTPS;
+ return ProtectionSpace::ServerType::FTPS;
ASSERT_NOT_REACHED();
- return ProtectionSpaceServerHTTP;
+ return ProtectionSpace::ServerType::HTTP;
}
-static ProtectionSpaceAuthenticationScheme scheme(NSURLProtectionSpace *space)
+static ProtectionSpace::AuthenticationScheme scheme(NSURLProtectionSpace *space)
{
NSString *method = space.authenticationMethod;
if ([method isEqualToString:NSURLAuthenticationMethodDefault])
- return ProtectionSpaceAuthenticationSchemeDefault;
+ return ProtectionSpace::AuthenticationScheme::Default;
if ([method isEqualToString:NSURLAuthenticationMethodHTTPBasic])
- return ProtectionSpaceAuthenticationSchemeHTTPBasic;
+ return ProtectionSpace::AuthenticationScheme::HTTPBasic;
if ([method isEqualToString:NSURLAuthenticationMethodHTTPDigest])
- return ProtectionSpaceAuthenticationSchemeHTTPDigest;
+ return ProtectionSpace::AuthenticationScheme::HTTPDigest;
if ([method isEqualToString:NSURLAuthenticationMethodHTMLForm])
- return ProtectionSpaceAuthenticationSchemeHTMLForm;
+ return ProtectionSpace::AuthenticationScheme::HTMLForm;
if ([method isEqualToString:NSURLAuthenticationMethodNTLM])
- return ProtectionSpaceAuthenticationSchemeNTLM;
+ return ProtectionSpace::AuthenticationScheme::NTLM;
if ([method isEqualToString:NSURLAuthenticationMethodNegotiate])
- return ProtectionSpaceAuthenticationSchemeNegotiate;
+ return ProtectionSpace::AuthenticationScheme::Negotiate;
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
if ([method isEqualToString:NSURLAuthenticationMethodClientCertificate])
- return ProtectionSpaceAuthenticationSchemeClientCertificateRequested;
+ return ProtectionSpace::AuthenticationScheme::ClientCertificateRequested;
if ([method isEqualToString:NSURLAuthenticationMethodServerTrust])
- return ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
+ return ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested;
#endif
if ([method isEqualToString:NSURLAuthenticationMethodOAuth])
- return ProtectionSpaceAuthenticationSchemeOAuth;
+ return ProtectionSpace::AuthenticationScheme::OAuth;
ASSERT_NOT_REACHED();
- return ProtectionSpaceAuthenticationSchemeUnknown;
+ return ProtectionSpace::AuthenticationScheme::Unknown;
}
ProtectionSpace::ProtectionSpace(NSURLProtectionSpace *space)
@@ -103,28 +103,28 @@
NSString *proxyType = nil;
NSString *protocol = nil;
switch (serverType()) {
- case ProtectionSpaceServerHTTP:
+ case ProtectionSpace::ServerType::HTTP:
protocol = @"http";
break;
- case ProtectionSpaceServerHTTPS:
+ case ProtectionSpace::ServerType::HTTPS:
protocol = @"https";
break;
- case ProtectionSpaceServerFTP:
+ case ProtectionSpace::ServerType::FTP:
protocol = @"ftp";
break;
- case ProtectionSpaceServerFTPS:
+ case ProtectionSpace::ServerType::FTPS:
protocol = @"ftps";
break;
- case ProtectionSpaceProxyHTTP:
+ case ProtectionSpace::ServerType::ProxyHTTP:
proxyType = NSURLProtectionSpaceHTTPProxy;
break;
- case ProtectionSpaceProxyHTTPS:
+ case ProtectionSpace::ServerType::ProxyHTTPS:
proxyType = NSURLProtectionSpaceHTTPSProxy;
break;
- case ProtectionSpaceProxyFTP:
+ case ProtectionSpace::ServerType::ProxyFTP:
proxyType = NSURLProtectionSpaceFTPProxy;
break;
- case ProtectionSpaceProxySOCKS:
+ case ProtectionSpace::ServerType::ProxySOCKS:
proxyType = NSURLProtectionSpaceSOCKSProxy;
break;
default:
@@ -133,33 +133,33 @@
NSString *method = nil;
switch (authenticationScheme()) {
- case ProtectionSpaceAuthenticationSchemeDefault:
+ case ProtectionSpace::AuthenticationScheme::Default:
method = NSURLAuthenticationMethodDefault;
break;
- case ProtectionSpaceAuthenticationSchemeHTTPBasic:
+ case ProtectionSpace::AuthenticationScheme::HTTPBasic:
method = NSURLAuthenticationMethodHTTPBasic;
break;
- case ProtectionSpaceAuthenticationSchemeHTTPDigest:
+ case ProtectionSpace::AuthenticationScheme::HTTPDigest:
method = NSURLAuthenticationMethodHTTPDigest;
break;
- case ProtectionSpaceAuthenticationSchemeHTMLForm:
+ case ProtectionSpace::AuthenticationScheme::HTMLForm:
method = NSURLAuthenticationMethodHTMLForm;
break;
- case ProtectionSpaceAuthenticationSchemeNTLM:
+ case ProtectionSpace::AuthenticationScheme::NTLM:
method = NSURLAuthenticationMethodNTLM;
break;
- case ProtectionSpaceAuthenticationSchemeNegotiate:
+ case ProtectionSpace::AuthenticationScheme::Negotiate:
method = NSURLAuthenticationMethodNegotiate;
break;
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
- case ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
+ case ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested:
method = NSURLAuthenticationMethodServerTrust;
break;
- case ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
+ case ProtectionSpace::AuthenticationScheme::ClientCertificateRequested:
method = NSURLAuthenticationMethodClientCertificate;
break;
#endif
- case ProtectionSpaceAuthenticationSchemeOAuth:
+ case ProtectionSpace::AuthenticationScheme::OAuth:
method = NSURLAuthenticationMethodOAuth;
break;
default:
Modified: trunk/Source/WebCore/platform/network/curl/AuthenticationChallenge.h (287223 => 287224)
--- trunk/Source/WebCore/platform/network/curl/AuthenticationChallenge.h 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/curl/AuthenticationChallenge.h 2021-12-18 17:46:14 UTC (rev 287224)
@@ -50,11 +50,11 @@
AuthenticationClient* authenticationClient() const { return m_authenticationClient.get(); }
private:
- ProtectionSpaceServerType protectionSpaceServerTypeFromURI(const URL&, bool isForProxy);
+ ProtectionSpace::ServerType protectionSpaceServerTypeFromURI(const URL&, bool isForProxy);
ProtectionSpace protectionSpaceForPasswordBased(const CurlResponse&, const ResourceResponse&);
ProtectionSpace protectionSpaceForServerTrust(const URL&, const CertificateInfo&);
std::optional<uint16_t> determineProxyPort(const URL&);
- ProtectionSpaceAuthenticationScheme authenticationSchemeFromCurlAuth(long);
+ ProtectionSpace::AuthenticationScheme authenticationSchemeFromCurlAuth(long);
String parseRealm(const ResourceResponse&);
void removeLeadingAndTrailingQuotes(String&);
Modified: trunk/Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -46,15 +46,15 @@
{
}
-ProtectionSpaceServerType AuthenticationChallenge::protectionSpaceServerTypeFromURI(const URL& url, bool isForProxy)
+ProtectionSpace::ServerType AuthenticationChallenge::protectionSpaceServerTypeFromURI(const URL& url, bool isForProxy)
{
if (url.protocolIs("https"))
- return isForProxy ? ProtectionSpaceProxyHTTPS : ProtectionSpaceServerHTTPS;
+ return isForProxy ? ProtectionSpace::ServerType::ProxyHTTPS : ProtectionSpace::ServerType::HTTPS;
if (url.protocolIs("http"))
- return isForProxy ? ProtectionSpaceProxyHTTP : ProtectionSpaceServerHTTP;
+ return isForProxy ? ProtectionSpace::ServerType::ProxyHTTP : ProtectionSpace::ServerType::HTTP;
if (url.protocolIs("ftp"))
- return isForProxy ? ProtectionSpaceProxyFTP : ProtectionSpaceServerFTP;
- return isForProxy ? ProtectionSpaceProxyHTTP : ProtectionSpaceServerHTTP;
+ return isForProxy ? ProtectionSpace::ServerType::ProxyFTP : ProtectionSpace::ServerType::FTP;
+ return isForProxy ? ProtectionSpace::ServerType::ProxyHTTP : ProtectionSpace::ServerType::HTTP;
}
ProtectionSpace AuthenticationChallenge::protectionSpaceForPasswordBased(const CurlResponse& curlResponse, const ResourceResponse& response)
@@ -75,7 +75,7 @@
{
auto port = determineProxyPort(url);
auto serverType = protectionSpaceServerTypeFromURI(url, false);
- auto authenticationScheme = ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
+ auto authenticationScheme = ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested;
return ProtectionSpace(url.host().toString(), static_cast<int>(port.value_or(0)), serverType, String(), authenticationScheme, certificateInfo);
}
@@ -96,17 +96,17 @@
return std::nullopt;
}
-ProtectionSpaceAuthenticationScheme AuthenticationChallenge::authenticationSchemeFromCurlAuth(long curlAuth)
+ProtectionSpace::AuthenticationScheme AuthenticationChallenge::authenticationSchemeFromCurlAuth(long curlAuth)
{
if (curlAuth & CURLAUTH_NTLM)
- return ProtectionSpaceAuthenticationSchemeNTLM;
+ return ProtectionSpace::AuthenticationScheme::NTLM;
if (curlAuth & CURLAUTH_NEGOTIATE)
- return ProtectionSpaceAuthenticationSchemeNegotiate;
+ return ProtectionSpace::AuthenticationScheme::Negotiate;
if (curlAuth & CURLAUTH_DIGEST)
- return ProtectionSpaceAuthenticationSchemeHTTPDigest;
+ return ProtectionSpace::AuthenticationScheme::HTTPDigest;
if (curlAuth & CURLAUTH_BASIC)
- return ProtectionSpaceAuthenticationSchemeHTTPBasic;
- return ProtectionSpaceAuthenticationSchemeUnknown;
+ return ProtectionSpace::AuthenticationScheme::HTTPBasic;
+ return ProtectionSpace::AuthenticationScheme::Unknown;
}
String AuthenticationChallenge::parseRealm(const ResourceResponse& response)
Modified: trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -64,22 +64,22 @@
m_messageQueue = nullptr;
}
-void CurlRequest::setAuthenticationScheme(ProtectionSpaceAuthenticationScheme scheme)
+void CurlRequest::setAuthenticationScheme(ProtectionSpace::AuthenticationScheme scheme)
{
switch (scheme) {
- case ProtectionSpaceAuthenticationSchemeHTTPBasic:
+ case ProtectionSpace::AuthenticationScheme::HTTPBasic:
m_authType = CURLAUTH_BASIC;
break;
- case ProtectionSpaceAuthenticationSchemeHTTPDigest:
+ case ProtectionSpace::AuthenticationScheme::HTTPDigest:
m_authType = CURLAUTH_DIGEST;
break;
- case ProtectionSpaceAuthenticationSchemeNTLM:
+ case ProtectionSpace::AuthenticationScheme::NTLM:
m_authType = CURLAUTH_NTLM;
break;
- case ProtectionSpaceAuthenticationSchemeNegotiate:
+ case ProtectionSpace::AuthenticationScheme::Negotiate:
m_authType = CURLAUTH_NEGOTIATE;
break;
Modified: trunk/Source/WebCore/platform/network/curl/CurlRequest.h (287223 => 287224)
--- trunk/Source/WebCore/platform/network/curl/CurlRequest.h 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/curl/CurlRequest.h 2021-12-18 17:46:14 UTC (rev 287224)
@@ -72,7 +72,7 @@
virtual ~CurlRequest();
void invalidateClient();
- WEBCORE_EXPORT void setAuthenticationScheme(ProtectionSpaceAuthenticationScheme);
+ WEBCORE_EXPORT void setAuthenticationScheme(ProtectionSpace::AuthenticationScheme);
WEBCORE_EXPORT void setUserPass(const String&, const String&);
bool isServerTrustEvaluationDisabled() { return m_shouldDisableServerTrustEvaluation; }
void disableServerTrustEvaluation() { m_shouldDisableServerTrustEvaluation = true; }
Modified: trunk/Source/WebCore/platform/network/curl/ProtectionSpaceCurl.h (287223 => 287224)
--- trunk/Source/WebCore/platform/network/curl/ProtectionSpaceCurl.h 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/curl/ProtectionSpaceCurl.h 2021-12-18 17:46:14 UTC (rev 287224)
@@ -37,12 +37,12 @@
{
}
- ProtectionSpace(const String& host, int port, ProtectionSpaceServerType serverType, const String& realm, ProtectionSpaceAuthenticationScheme authenticationScheme)
+ ProtectionSpace(const String& host, int port, ServerType serverType, const String& realm, AuthenticationScheme authenticationScheme)
: ProtectionSpaceBase(host, port, serverType, realm, authenticationScheme)
{
}
- ProtectionSpace(const String& host, int port, ProtectionSpaceServerType serverType, const String& realm, ProtectionSpaceAuthenticationScheme authenticationScheme, const CertificateInfo& certificateInfo)
+ ProtectionSpace(const String& host, int port, ServerType serverType, const String& realm, AuthenticationScheme authenticationScheme, const CertificateInfo& certificateInfo)
: ProtectionSpaceBase(host, port, serverType, realm, authenticationScheme)
, m_certificateInfo(certificateInfo)
{
Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -86,7 +86,7 @@
if (auto credential = getCredential(d->m_firstRequest, false)) {
d->m_curlRequest->setUserPass(credential->user(), credential->password());
- d->m_curlRequest->setAuthenticationScheme(ProtectionSpaceAuthenticationSchemeHTTPBasic);
+ d->m_curlRequest->setAuthenticationScheme(ProtectionSpace::AuthenticationScheme::HTTPBasic);
}
d->m_curlRequest->start();
@@ -390,7 +390,7 @@
if (auto credential = handle->getCredential(handle->d->m_firstRequest, false)) {
handle->d->m_curlRequest->setUserPass(credential->user(), credential->password());
- handle->d->m_curlRequest->setAuthenticationScheme(ProtectionSpaceAuthenticationSchemeHTTPBasic);
+ handle->d->m_curlRequest->setAuthenticationScheme(ProtectionSpace::AuthenticationScheme::HTTPBasic);
}
handle->d->m_curlRequest->start();
Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (287223 => 287224)
--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm 2021-12-18 17:46:14 UTC (rev 287224)
@@ -589,7 +589,7 @@
return;
}
- if (credential.persistence() == CredentialPersistenceForSession && challenge.protectionSpace().authenticationScheme() != ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
+ if (credential.persistence() == CredentialPersistenceForSession && challenge.protectionSpace().authenticationScheme() != ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested) {
// Manage per-session credentials internally, because once NSURLCredentialPersistenceForSession is used, there is no way
// to ignore it for a particular request (short of removing it altogether).
Credential webCredential(credential, CredentialPersistenceNone);
Modified: trunk/Source/WebCore/platform/network/soup/AuthenticationChallengeSoup.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/soup/AuthenticationChallengeSoup.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/soup/AuthenticationChallengeSoup.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -35,31 +35,31 @@
namespace WebCore {
-static ProtectionSpaceServerType protectionSpaceServerTypeFromURL(const URL& url, bool isForProxy)
+static ProtectionSpace::ServerType protectionSpaceServerTypeFromURL(const URL& url, bool isForProxy)
{
if (url.protocolIs("https"))
- return isForProxy ? ProtectionSpaceProxyHTTPS : ProtectionSpaceServerHTTPS;
+ return isForProxy ? ProtectionSpace::ServerType::ProxyHTTPS : ProtectionSpace::ServerType::HTTPS;
if (url.protocolIs("http"))
- return isForProxy ? ProtectionSpaceProxyHTTP : ProtectionSpaceServerHTTP;
+ return isForProxy ? ProtectionSpace::ServerType::ProxyHTTP : ProtectionSpace::ServerType::HTTP;
if (url.protocolIs("ftp"))
- return isForProxy ? ProtectionSpaceProxyFTP : ProtectionSpaceServerFTP;
- return isForProxy ? ProtectionSpaceProxyHTTP : ProtectionSpaceServerHTTP;
+ return isForProxy ? ProtectionSpace::ServerType::ProxyFTP : ProtectionSpace::ServerType::FTP;
+ return isForProxy ? ProtectionSpace::ServerType::ProxyHTTP : ProtectionSpace::ServerType::HTTP;
}
static ProtectionSpace protectionSpaceFromSoupAuthAndURL(SoupAuth* soupAuth, const URL& url)
{
const char* schemeName = soup_auth_get_scheme_name(soupAuth);
- ProtectionSpaceAuthenticationScheme scheme;
+ ProtectionSpace::AuthenticationScheme scheme;
if (!g_ascii_strcasecmp(schemeName, "basic"))
- scheme = ProtectionSpaceAuthenticationSchemeHTTPBasic;
+ scheme = ProtectionSpace::AuthenticationScheme::HTTPBasic;
else if (!g_ascii_strcasecmp(schemeName, "digest"))
- scheme = ProtectionSpaceAuthenticationSchemeHTTPDigest;
+ scheme = ProtectionSpace::AuthenticationScheme::HTTPDigest;
else if (!g_ascii_strcasecmp(schemeName, "ntlm"))
- scheme = ProtectionSpaceAuthenticationSchemeNTLM;
+ scheme = ProtectionSpace::AuthenticationScheme::NTLM;
else if (!g_ascii_strcasecmp(schemeName, "negotiate"))
- scheme = ProtectionSpaceAuthenticationSchemeNegotiate;
+ scheme = ProtectionSpace::AuthenticationScheme::Negotiate;
else
- scheme = ProtectionSpaceAuthenticationSchemeUnknown;
+ scheme = ProtectionSpace::AuthenticationScheme::Unknown;
#if USE(SOUP2)
auto host = url.host();
@@ -96,7 +96,7 @@
if (!port)
port = defaultPortForProtocol(url.protocol());
return ProtectionSpace(url.host().toString(), static_cast<int>(port.value_or(0)), protectionSpaceServerTypeFromURL(url, false), { },
- ProtectionSpaceAuthenticationSchemeClientCertificateRequested);
+ ProtectionSpace::AuthenticationScheme::ClientCertificateRequested);
}
AuthenticationChallenge::AuthenticationChallenge(SoupMessage* soupMessage, GTlsClientConnection*)
@@ -114,7 +114,7 @@
if (!port)
port = defaultPortForProtocol(url.protocol());
return ProtectionSpace(url.host().toString(), static_cast<int>(port.value_or(0)), protectionSpaceServerTypeFromURL(url, false),
- String::fromUTF8(g_tls_password_get_description(tlsPassword)), ProtectionSpaceAuthenticationSchemeClientCertificatePINRequested);
+ String::fromUTF8(g_tls_password_get_description(tlsPassword)), ProtectionSpace::AuthenticationScheme::ClientCertificatePINRequested);
}
AuthenticationChallenge::AuthenticationChallenge(SoupMessage* soupMessage, GTlsPassword* tlsPassword)
Modified: trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp (287223 => 287224)
--- trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -88,20 +88,20 @@
}
#if USE(LIBSECRET)
-static const char* schemeFromProtectionSpaceServerType(ProtectionSpaceServerType serverType)
+static const char* schemeFromProtectionSpaceServerType(ProtectionSpace::ServerType serverType)
{
switch (serverType) {
- case ProtectionSpaceServerHTTP:
- case ProtectionSpaceProxyHTTP:
+ case ProtectionSpace::ServerType::HTTP:
+ case ProtectionSpace::ServerType::ProxyHTTP:
return "http";
- case ProtectionSpaceServerHTTPS:
- case ProtectionSpaceProxyHTTPS:
+ case ProtectionSpace::ServerType::HTTPS:
+ case ProtectionSpace::ServerType::ProxyHTTPS:
return "https";
- case ProtectionSpaceServerFTP:
- case ProtectionSpaceProxyFTP:
+ case ProtectionSpace::ServerType::FTP:
+ case ProtectionSpace::ServerType::ProxyFTP:
return "ftp";
- case ProtectionSpaceServerFTPS:
- case ProtectionSpaceProxySOCKS:
+ case ProtectionSpace::ServerType::FTPS:
+ case ProtectionSpace::ServerType::ProxySOCKS:
break;
}
@@ -108,28 +108,28 @@
RELEASE_ASSERT_NOT_REACHED();
}
-static const char* authTypeFromProtectionSpaceAuthenticationScheme(ProtectionSpaceAuthenticationScheme scheme)
+static const char* authTypeFromProtectionSpaceAuthenticationScheme(ProtectionSpace::AuthenticationScheme scheme)
{
switch (scheme) {
- case ProtectionSpaceAuthenticationSchemeDefault:
- case ProtectionSpaceAuthenticationSchemeHTTPBasic:
+ case ProtectionSpace::AuthenticationScheme::Default:
+ case ProtectionSpace::AuthenticationScheme::HTTPBasic:
return "Basic";
- case ProtectionSpaceAuthenticationSchemeHTTPDigest:
+ case ProtectionSpace::AuthenticationScheme::HTTPDigest:
return "Digest";
- case ProtectionSpaceAuthenticationSchemeNTLM:
+ case ProtectionSpace::AuthenticationScheme::NTLM:
return "NTLM";
- case ProtectionSpaceAuthenticationSchemeNegotiate:
+ case ProtectionSpace::AuthenticationScheme::Negotiate:
return "Negotiate";
- case ProtectionSpaceAuthenticationSchemeHTMLForm:
- case ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
- case ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
+ case ProtectionSpace::AuthenticationScheme::HTMLForm:
+ case ProtectionSpace::AuthenticationScheme::ClientCertificateRequested:
+ case ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested:
ASSERT_NOT_REACHED();
break;
- case ProtectionSpaceAuthenticationSchemeClientCertificatePINRequested:
+ case ProtectionSpace::AuthenticationScheme::ClientCertificatePINRequested:
return "Certificate PIN";
- case ProtectionSpaceAuthenticationSchemeOAuth:
+ case ProtectionSpace::AuthenticationScheme::OAuth:
return "OAuth";
- case ProtectionSpaceAuthenticationSchemeUnknown:
+ case ProtectionSpace::AuthenticationScheme::Unknown:
return "unknown";
}
Modified: trunk/Source/WebKit/ChangeLog (287223 => 287224)
--- trunk/Source/WebKit/ChangeLog 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/ChangeLog 2021-12-18 17:46:14 UTC (rev 287224)
@@ -1,3 +1,43 @@
+2021-12-18 Chris Dumez <[email protected]>
+
+ Convert ProtectionSpace enums into enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=234455
+
+ Reviewed by Alex Christensen.
+
+ * NetworkProcess/NetworkCORSPreflightChecker.cpp:
+ (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
+ * NetworkProcess/NetworkLoad.cpp:
+ (WebKit::NetworkLoad::didReceiveChallenge):
+ * NetworkProcess/PingLoad.cpp:
+ (WebKit::PingLoad::didReceiveChallenge):
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):
+ * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
+ (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
+ (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
+ (WebKit::NetworkDataTaskCurl::restartWithCredential):
+ * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
+ (WebKit::NetworkDataTaskSoup::completeAuthentication):
+ (WebKit::NetworkDataTaskSoup::cancelAuthentication):
+ * Shared/Authentication/AuthenticationManager.cpp:
+ (WebKit::canCoalesceChallenge):
+ * Shared/WebCoreArgumentCoders.cpp:
+ (IPC::ArgumentCoder<ProtectionSpace>::decode):
+ * Shared/curl/WebCoreArgumentCodersCurl.cpp:
+ (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
+ * UIProcess/API/C/WKAPICast.h:
+ (WebKit::toAPI):
+ * UIProcess/API/glib/WebKitAuthenticationRequest.cpp:
+ (webkit_authentication_request_get_security_origin):
+ * UIProcess/Authentication/WebProtectionSpace.cpp:
+ (WebKit::WebProtectionSpace::serverType const):
+ (WebKit::WebProtectionSpace::authenticationScheme const):
+ * UIProcess/Authentication/WebProtectionSpace.h:
+ * UIProcess/Network/NetworkProcessProxy.cpp:
+ (WebKit::NetworkProcessProxy::processAuthenticationChallenge):
+ (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
+
2021-12-17 Wenson Hsieh <[email protected]>
Add support for detecting modal containers that contain a given search term
Modified: trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp (287223 => 287224)
--- trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -95,11 +95,11 @@
void NetworkCORSPreflightChecker::didReceiveChallenge(WebCore::AuthenticationChallenge&& challenge, NegotiatedLegacyTLS negotiatedLegacyTLS, ChallengeCompletionHandler&& completionHandler)
{
- CORS_CHECKER_RELEASE_LOG("didReceiveChallenge, authentication scheme: %u", challenge.protectionSpace().authenticationScheme());
+ CORS_CHECKER_RELEASE_LOG("didReceiveChallenge, authentication scheme: %u", static_cast<unsigned>(challenge.protectionSpace().authenticationScheme()));
auto scheme = challenge.protectionSpace().authenticationScheme();
- bool isTLSHandshake = scheme == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested
- || scheme == ProtectionSpaceAuthenticationSchemeClientCertificateRequested;
+ bool isTLSHandshake = scheme == ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested
+ || scheme == ProtectionSpace::AuthenticationScheme::ClientCertificateRequested;
if (!isTLSHandshake) {
completionHandler(AuthenticationChallengeDisposition::UseCredential, { });
Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp (287223 => 287224)
--- trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -215,8 +215,8 @@
m_client.get().didReceiveChallenge(challenge);
auto scheme = challenge.protectionSpace().authenticationScheme();
- bool isTLSHandshake = scheme == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested
- || scheme == ProtectionSpaceAuthenticationSchemeClientCertificateRequested;
+ bool isTLSHandshake = scheme == ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested
+ || scheme == ProtectionSpace::AuthenticationScheme::ClientCertificateRequested;
if (!isAllowedToAskUserForCredentials() && !isTLSHandshake && !challenge.protectionSpace().isProxy()) {
m_client.get().didBlockAuthenticationChallenge();
completionHandler(AuthenticationChallengeDisposition::UseCredential, { });
Modified: trunk/Source/WebKit/NetworkProcess/PingLoad.cpp (287223 => 287224)
--- trunk/Source/WebKit/NetworkProcess/PingLoad.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/NetworkProcess/PingLoad.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -151,7 +151,7 @@
void PingLoad::didReceiveChallenge(AuthenticationChallenge&& challenge, NegotiatedLegacyTLS negotiatedLegacyTLS, ChallengeCompletionHandler&& completionHandler)
{
PING_RELEASE_LOG("didReceiveChallenge");
- if (challenge.protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
+ if (challenge.protectionSpace().authenticationScheme() == ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested) {
m_networkLoadChecker->networkProcess().authenticationManager().didReceiveAuthenticationChallenge(m_sessionID, m_parameters.webPageProxyID, m_parameters.topOrigin ? &m_parameters.topOrigin->data() : nullptr, challenge, negotiatedLegacyTLS, WTFMove(completionHandler));
return;
}
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (287223 => 287224)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2021-12-18 17:46:14 UTC (rev 287224)
@@ -1617,7 +1617,7 @@
if (!certificates)
return false;
- bool requireServerCertificates = challenge.protectionSpace().authenticationScheme() == WebCore::ProtectionSpaceAuthenticationScheme::ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
+ bool requireServerCertificates = challenge.protectionSpace().authenticationScheme() == WebCore::ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested;
RetainPtr<SecPolicyRef> policy = adoptCF(SecPolicyCreateSSL(requireServerCertificates, host.createCFString().get()));
SecTrustRef trustRef = nullptr;
Modified: trunk/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp (287223 => 287224)
--- trunk/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -75,7 +75,7 @@
m_curlRequest = createCurlRequest(WTFMove(request));
if (!m_initialCredential.isEmpty()) {
m_curlRequest->setUserPass(m_initialCredential.user(), m_initialCredential.password());
- m_curlRequest->setAuthenticationScheme(ProtectionSpaceAuthenticationSchemeHTTPBasic);
+ m_curlRequest->setAuthenticationScheme(ProtectionSpace::AuthenticationScheme::HTTPBasic);
}
m_curlRequest->start();
}
@@ -313,7 +313,7 @@
m_curlRequest = createCurlRequest(WTFMove(requestCopy));
if (didChangeCredential && !m_initialCredential.isEmpty()) {
m_curlRequest->setUserPass(m_initialCredential.user(), m_initialCredential.password());
- m_curlRequest->setAuthenticationScheme(ProtectionSpaceAuthenticationSchemeHTTPBasic);
+ m_curlRequest->setAuthenticationScheme(ProtectionSpace::AuthenticationScheme::HTTPBasic);
}
m_curlRequest->start();
@@ -427,7 +427,7 @@
ASSERT(m_curlRequest);
auto previousRequest = m_curlRequest->resourceRequest();
- auto shouldDisableServerTrustEvaluation = protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested || m_curlRequest->isServerTrustEvaluationDisabled();
+ auto shouldDisableServerTrustEvaluation = protectionSpace.authenticationScheme() == ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested || m_curlRequest->isServerTrustEvaluationDisabled();
m_curlRequest->cancel();
m_curlRequest = createCurlRequest(WTFMove(previousRequest), RequestStatus::ReusedRequest);
Modified: trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp (287223 => 287224)
--- trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -688,16 +688,16 @@
void NetworkDataTaskSoup::completeAuthentication(const AuthenticationChallenge& challenge, const Credential& credential)
{
switch (challenge.protectionSpace().authenticationScheme()) {
- case ProtectionSpaceAuthenticationSchemeDefault:
- case ProtectionSpaceAuthenticationSchemeHTTPBasic:
- case ProtectionSpaceAuthenticationSchemeHTTPDigest:
- case ProtectionSpaceAuthenticationSchemeHTMLForm:
- case ProtectionSpaceAuthenticationSchemeNTLM:
- case ProtectionSpaceAuthenticationSchemeNegotiate:
- case ProtectionSpaceAuthenticationSchemeOAuth:
+ case ProtectionSpace::AuthenticationScheme::Default:
+ case ProtectionSpace::AuthenticationScheme::HTTPBasic:
+ case ProtectionSpace::AuthenticationScheme::HTTPDigest:
+ case ProtectionSpace::AuthenticationScheme::HTMLForm:
+ case ProtectionSpace::AuthenticationScheme::NTLM:
+ case ProtectionSpace::AuthenticationScheme::Negotiate:
+ case ProtectionSpace::AuthenticationScheme::OAuth:
soup_auth_authenticate(challenge.soupAuth(), credential.user().utf8().data(), credential.password().utf8().data());
break;
- case ProtectionSpaceAuthenticationSchemeClientCertificatePINRequested: {
+ case ProtectionSpace::AuthenticationScheme::ClientCertificatePINRequested: {
#if USE(SOUP2)
ASSERT_NOT_REACHED();
#else
@@ -707,7 +707,7 @@
#endif
break;
}
- case ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
+ case ProtectionSpace::AuthenticationScheme::ClientCertificateRequested:
#if USE(SOUP2)
ASSERT_NOT_REACHED();
#else
@@ -714,8 +714,8 @@
soup_message_set_tls_client_certificate(m_soupMessage.get(), credential.certificate());
#endif
break;
- case ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
- case ProtectionSpaceAuthenticationSchemeUnknown:
+ case ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested:
+ case ProtectionSpace::AuthenticationScheme::Unknown:
break;
}
}
@@ -723,16 +723,16 @@
void NetworkDataTaskSoup::cancelAuthentication(const AuthenticationChallenge& challenge)
{
switch (challenge.protectionSpace().authenticationScheme()) {
- case ProtectionSpaceAuthenticationSchemeDefault:
- case ProtectionSpaceAuthenticationSchemeHTTPBasic:
- case ProtectionSpaceAuthenticationSchemeHTTPDigest:
- case ProtectionSpaceAuthenticationSchemeHTMLForm:
- case ProtectionSpaceAuthenticationSchemeNTLM:
- case ProtectionSpaceAuthenticationSchemeNegotiate:
- case ProtectionSpaceAuthenticationSchemeOAuth:
+ case ProtectionSpace::AuthenticationScheme::Default:
+ case ProtectionSpace::AuthenticationScheme::HTTPBasic:
+ case ProtectionSpace::AuthenticationScheme::HTTPDigest:
+ case ProtectionSpace::AuthenticationScheme::HTMLForm:
+ case ProtectionSpace::AuthenticationScheme::NTLM:
+ case ProtectionSpace::AuthenticationScheme::Negotiate:
+ case ProtectionSpace::AuthenticationScheme::OAuth:
soup_auth_cancel(challenge.soupAuth());
break;
- case ProtectionSpaceAuthenticationSchemeClientCertificatePINRequested:
+ case ProtectionSpace::AuthenticationScheme::ClientCertificatePINRequested:
#if USE(SOUP2)
ASSERT_NOT_REACHED();
#else
@@ -739,7 +739,7 @@
soup_message_tls_client_certificate_password_request_complete(m_soupMessage.get());
#endif
break;
- case ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
+ case ProtectionSpace::AuthenticationScheme::ClientCertificateRequested:
#if USE(SOUP2)
ASSERT_NOT_REACHED();
#else
@@ -746,8 +746,8 @@
soup_message_set_tls_client_certificate(m_soupMessage.get(), nullptr);
#endif
break;
- case ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
- case ProtectionSpaceAuthenticationSchemeUnknown:
+ case ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested:
+ case ProtectionSpace::AuthenticationScheme::Unknown:
break;
}
}
Modified: trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp (287223 => 287224)
--- trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -45,7 +45,7 @@
static bool canCoalesceChallenge(const WebCore::AuthenticationChallenge& challenge)
{
// Do not coalesce server trust evaluation requests because ProtectionSpace comparison does not evaluate server trust (e.g. certificate).
- return challenge.protectionSpace().authenticationScheme() != ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
+ return challenge.protectionSpace().authenticationScheme() != ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested;
}
const char* AuthenticationManager::supplementName()
Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (287223 => 287224)
--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -962,11 +962,11 @@
if (!decoder.decode(realm))
return false;
- ProtectionSpaceAuthenticationScheme authenticationScheme;
+ ProtectionSpace::AuthenticationScheme authenticationScheme;
if (!decoder.decode(authenticationScheme))
return false;
- ProtectionSpaceServerType serverType;
+ ProtectionSpace::ServerType serverType;
if (!decoder.decode(serverType))
return false;
Modified: trunk/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp (287223 => 287224)
--- trunk/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -163,11 +163,11 @@
if (!decoder.decode(realm))
return false;
- ProtectionSpaceAuthenticationScheme authenticationScheme;
+ ProtectionSpace::AuthenticationScheme authenticationScheme;
if (!decoder.decode(authenticationScheme))
return false;
- ProtectionSpaceServerType serverType;
+ ProtectionSpace::ServerType serverType;
if (!decoder.decode(serverType))
return false;
Modified: trunk/Source/WebKit/UIProcess/API/C/WKAPICast.h (287223 => 287224)
--- trunk/Source/WebKit/UIProcess/API/C/WKAPICast.h 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/UIProcess/API/C/WKAPICast.h 2021-12-18 17:46:14 UTC (rev 287224)
@@ -290,49 +290,49 @@
return WebCore::EditableLinkBehavior::NeverLive;
}
-inline WKProtectionSpaceServerType toAPI(WebCore::ProtectionSpaceServerType type)
+inline WKProtectionSpaceServerType toAPI(WebCore::ProtectionSpace::ServerType type)
{
switch (type) {
- case WebCore::ProtectionSpaceServerHTTP:
+ case WebCore::ProtectionSpace::ServerType::HTTP:
return kWKProtectionSpaceServerTypeHTTP;
- case WebCore::ProtectionSpaceServerHTTPS:
+ case WebCore::ProtectionSpace::ServerType::HTTPS:
return kWKProtectionSpaceServerTypeHTTPS;
- case WebCore::ProtectionSpaceServerFTP:
+ case WebCore::ProtectionSpace::ServerType::FTP:
return kWKProtectionSpaceServerTypeFTP;
- case WebCore::ProtectionSpaceServerFTPS:
+ case WebCore::ProtectionSpace::ServerType::FTPS:
return kWKProtectionSpaceServerTypeFTPS;
- case WebCore::ProtectionSpaceProxyHTTP:
+ case WebCore::ProtectionSpace::ServerType::ProxyHTTP:
return kWKProtectionSpaceProxyTypeHTTP;
- case WebCore::ProtectionSpaceProxyHTTPS:
+ case WebCore::ProtectionSpace::ServerType::ProxyHTTPS:
return kWKProtectionSpaceProxyTypeHTTPS;
- case WebCore::ProtectionSpaceProxyFTP:
+ case WebCore::ProtectionSpace::ServerType::ProxyFTP:
return kWKProtectionSpaceProxyTypeFTP;
- case WebCore::ProtectionSpaceProxySOCKS:
+ case WebCore::ProtectionSpace::ServerType::ProxySOCKS:
return kWKProtectionSpaceProxyTypeSOCKS;
}
return kWKProtectionSpaceServerTypeHTTP;
}
-inline WKProtectionSpaceAuthenticationScheme toAPI(WebCore::ProtectionSpaceAuthenticationScheme type)
+inline WKProtectionSpaceAuthenticationScheme toAPI(WebCore::ProtectionSpace::AuthenticationScheme type)
{
switch (type) {
- case WebCore::ProtectionSpaceAuthenticationSchemeDefault:
+ case WebCore::ProtectionSpace::AuthenticationScheme::Default:
return kWKProtectionSpaceAuthenticationSchemeDefault;
- case WebCore::ProtectionSpaceAuthenticationSchemeHTTPBasic:
+ case WebCore::ProtectionSpace::AuthenticationScheme::HTTPBasic:
return kWKProtectionSpaceAuthenticationSchemeHTTPBasic;
- case WebCore::ProtectionSpaceAuthenticationSchemeHTTPDigest:
+ case WebCore::ProtectionSpace::AuthenticationScheme::HTTPDigest:
return kWKProtectionSpaceAuthenticationSchemeHTTPDigest;
- case WebCore::ProtectionSpaceAuthenticationSchemeHTMLForm:
+ case WebCore::ProtectionSpace::AuthenticationScheme::HTMLForm:
return kWKProtectionSpaceAuthenticationSchemeHTMLForm;
- case WebCore::ProtectionSpaceAuthenticationSchemeNTLM:
+ case WebCore::ProtectionSpace::AuthenticationScheme::NTLM:
return kWKProtectionSpaceAuthenticationSchemeNTLM;
- case WebCore::ProtectionSpaceAuthenticationSchemeNegotiate:
+ case WebCore::ProtectionSpace::AuthenticationScheme::Negotiate:
return kWKProtectionSpaceAuthenticationSchemeNegotiate;
- case WebCore::ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
+ case WebCore::ProtectionSpace::AuthenticationScheme::ClientCertificateRequested:
return kWKProtectionSpaceAuthenticationSchemeClientCertificateRequested;
- case WebCore::ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
+ case WebCore::ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested:
return kWKProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
- case WebCore::ProtectionSpaceAuthenticationSchemeOAuth:
+ case WebCore::ProtectionSpace::AuthenticationScheme::OAuth:
return kWKProtectionSpaceAuthenticationSchemeOAuth;
default:
return kWKProtectionSpaceAuthenticationSchemeUnknown;
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitAuthenticationRequest.cpp (287223 => 287224)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitAuthenticationRequest.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitAuthenticationRequest.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -79,28 +79,28 @@
WEBKIT_DEFINE_TYPE(WebKitAuthenticationRequest, webkit_authentication_request, G_TYPE_OBJECT)
-static inline WebKitAuthenticationScheme toWebKitAuthenticationScheme(WebCore::ProtectionSpaceAuthenticationScheme coreScheme)
+static inline WebKitAuthenticationScheme toWebKitAuthenticationScheme(WebCore::ProtectionSpace::AuthenticationScheme coreScheme)
{
switch (coreScheme) {
- case WebCore::ProtectionSpaceAuthenticationSchemeDefault:
+ case WebCore::ProtectionSpace::AuthenticationScheme::Default:
return WEBKIT_AUTHENTICATION_SCHEME_DEFAULT;
- case WebCore::ProtectionSpaceAuthenticationSchemeHTTPBasic:
+ case WebCore::ProtectionSpace::AuthenticationScheme::HTTPBasic:
return WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC;
- case WebCore::ProtectionSpaceAuthenticationSchemeHTTPDigest:
+ case WebCore::ProtectionSpace::AuthenticationScheme::HTTPDigest:
return WEBKIT_AUTHENTICATION_SCHEME_HTTP_DIGEST;
- case WebCore::ProtectionSpaceAuthenticationSchemeHTMLForm:
+ case WebCore::ProtectionSpace::AuthenticationScheme::HTMLForm:
return WEBKIT_AUTHENTICATION_SCHEME_HTML_FORM;
- case WebCore::ProtectionSpaceAuthenticationSchemeNTLM:
+ case WebCore::ProtectionSpace::AuthenticationScheme::NTLM:
return WEBKIT_AUTHENTICATION_SCHEME_NTLM;
- case WebCore::ProtectionSpaceAuthenticationSchemeNegotiate:
+ case WebCore::ProtectionSpace::AuthenticationScheme::Negotiate:
return WEBKIT_AUTHENTICATION_SCHEME_NEGOTIATE;
- case WebCore::ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
+ case WebCore::ProtectionSpace::AuthenticationScheme::ClientCertificateRequested:
return WEBKIT_AUTHENTICATION_SCHEME_CLIENT_CERTIFICATE_REQUESTED;
- case WebCore::ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
+ case WebCore::ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested:
return WEBKIT_AUTHENTICATION_SCHEME_SERVER_TRUST_EVALUATION_REQUESTED;
- case WebCore::ProtectionSpaceAuthenticationSchemeClientCertificatePINRequested:
+ case WebCore::ProtectionSpace::AuthenticationScheme::ClientCertificatePINRequested:
return WEBKIT_AUTHENTICATION_SCHEME_CLIENT_CERTIFICATE_PIN_REQUESTED;
- case WebCore::ProtectionSpaceAuthenticationSchemeUnknown:
+ case WebCore::ProtectionSpace::AuthenticationScheme::Unknown:
return WEBKIT_AUTHENTICATION_SCHEME_UNKNOWN;
default:
ASSERT_NOT_REACHED();
@@ -348,22 +348,22 @@
const auto& protectionSpace = request->priv->authenticationChallenge->core().protectionSpace();
String protocol;
switch (protectionSpace.serverType()) {
- case ProtectionSpaceServerHTTP:
- case ProtectionSpaceProxyHTTP:
+ case ProtectionSpace::ServerType::HTTP:
+ case ProtectionSpace::ServerType::ProxyHTTP:
protocol = "http"_s;
break;
- case ProtectionSpaceServerHTTPS:
- case ProtectionSpaceProxyHTTPS:
+ case ProtectionSpace::ServerType::HTTPS:
+ case ProtectionSpace::ServerType::ProxyHTTPS:
protocol = "https"_s;
break;
- case ProtectionSpaceServerFTP:
- case ProtectionSpaceProxyFTP:
+ case ProtectionSpace::ServerType::FTP:
+ case ProtectionSpace::ServerType::ProxyFTP:
protocol = "ftp"_s;
break;
- case ProtectionSpaceServerFTPS:
+ case ProtectionSpace::ServerType::FTPS:
protocol = "ftps"_s;
break;
- case ProtectionSpaceProxySOCKS:
+ case ProtectionSpace::ServerType::ProxySOCKS:
protocol = "socks"_s;
break;
}
Modified: trunk/Source/WebKit/UIProcess/Authentication/WebProtectionSpace.cpp (287223 => 287224)
--- trunk/Source/WebKit/UIProcess/Authentication/WebProtectionSpace.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/UIProcess/Authentication/WebProtectionSpace.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -55,7 +55,7 @@
return m_coreProtectionSpace.isProxy();
}
-WebCore::ProtectionSpaceServerType WebProtectionSpace::serverType() const
+WebCore::ProtectionSpace::ServerType WebProtectionSpace::serverType() const
{
return m_coreProtectionSpace.serverType();
}
@@ -65,7 +65,7 @@
return m_coreProtectionSpace.receivesCredentialSecurely();
}
-WebCore::ProtectionSpaceAuthenticationScheme WebProtectionSpace::authenticationScheme() const
+WebCore::ProtectionSpace::AuthenticationScheme WebProtectionSpace::authenticationScheme() const
{
return m_coreProtectionSpace.authenticationScheme();
}
Modified: trunk/Source/WebKit/UIProcess/Authentication/WebProtectionSpace.h (287223 => 287224)
--- trunk/Source/WebKit/UIProcess/Authentication/WebProtectionSpace.h 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/UIProcess/Authentication/WebProtectionSpace.h 2021-12-18 17:46:14 UTC (rev 287224)
@@ -43,9 +43,9 @@
int port() const;
const String& realm() const;
bool isProxy() const;
- WebCore::ProtectionSpaceServerType serverType() const;
+ WebCore::ProtectionSpace::ServerType serverType() const;
bool receivesCredentialSecurely() const;
- WebCore::ProtectionSpaceAuthenticationScheme authenticationScheme() const;
+ WebCore::ProtectionSpace::AuthenticationScheme authenticationScheme() const;
const WebCore::ProtectionSpace& protectionSpace() const { return m_coreProtectionSpace; }
Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (287223 => 287224)
--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -421,7 +421,7 @@
void NetworkProcessProxy::processAuthenticationChallenge(PAL::SessionID sessionID, Ref<AuthenticationChallengeProxy>&& authenticationChallenge)
{
auto* store = websiteDataStoreFromSessionID(sessionID);
- if (!store || authenticationChallenge->core().protectionSpace().authenticationScheme() != ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
+ if (!store || authenticationChallenge->core().protectionSpace().authenticationScheme() != ProtectionSpace::AuthenticationScheme::ServerTrustEvaluationRequested) {
authenticationChallenge->listener().completeChallenge(AuthenticationChallengeDisposition::PerformDefaultHandling);
return;
}
@@ -432,7 +432,7 @@
{
#if HAVE(SEC_KEY_PROXY)
WeakPtr<SecKeyProxyStore> secKeyProxyStore;
- if (coreChallenge.protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested) {
+ if (coreChallenge.protectionSpace().authenticationScheme() == ProtectionSpace::AuthenticationScheme::ClientCertificateRequested) {
if (auto* store = websiteDataStoreFromSessionID(sessionID)) {
auto newSecKeyProxyStore = SecKeyProxyStore::create();
secKeyProxyStore = newSecKeyProxyStore;
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (287223 => 287224)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2021-12-18 17:46:14 UTC (rev 287224)
@@ -1,3 +1,13 @@
+2021-12-18 Chris Dumez <[email protected]>
+
+ Convert ProtectionSpace enums into enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=234455
+
+ Reviewed by Alex Christensen.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace):
+
2021-12-16 Alex Christensen <[email protected]>
Fix iOS debug build
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (287223 => 287224)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm 2021-12-18 17:46:14 UTC (rev 287224)
@@ -429,7 +429,7 @@
// If our resource load delegate doesn't handle the question, then only send authentication
// challenges for pre-iOS-3.0, pre-10.6 protection spaces. This is the same as the default implementation
// in CFNetwork.
- return (protectionSpace.authenticationScheme() < WebCore::ProtectionSpaceAuthenticationSchemeClientCertificateRequested);
+ return (protectionSpace.authenticationScheme() < WebCore::ProtectionSpace::AuthenticationScheme::ClientCertificateRequested);
}
#endif
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (287223 => 287224)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2021-12-18 17:46:14 UTC (rev 287224)
@@ -1,3 +1,16 @@
+2021-12-18 Chris Dumez <[email protected]>
+
+ Convert ProtectionSpace enums into enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=234455
+
+ Reviewed by Alex Christensen.
+
+ * WebURLProtectionSpace.cpp:
+ (WebURLProtectionSpace::authenticationMethod):
+ (coreScheme):
+ (WebURLProtectionSpace::initWithHost):
+ (WebURLProtectionSpace::initWithProxyHost):
+
2021-12-14 Jean-Yves Avenard <[email protected]>
Rename SharedBuffer classes.
Modified: trunk/Source/WebKitLegacy/win/WebURLProtectionSpace.cpp (287223 => 287224)
--- trunk/Source/WebKitLegacy/win/WebURLProtectionSpace.cpp 2021-12-18 17:18:25 UTC (rev 287223)
+++ trunk/Source/WebKitLegacy/win/WebURLProtectionSpace.cpp 2021-12-18 17:46:14 UTC (rev 287224)
@@ -102,16 +102,16 @@
return E_POINTER;
switch (m_protectionSpace.authenticationScheme()) {
- case ProtectionSpaceAuthenticationSchemeDefault:
+ case ProtectionSpace::AuthenticationScheme::Default:
*result = SysAllocString(WebURLAuthenticationMethodDefault);
break;
- case ProtectionSpaceAuthenticationSchemeHTTPBasic:
+ case ProtectionSpace::AuthenticationScheme::HTTPBasic:
*result = SysAllocString(WebURLAuthenticationMethodHTTPBasic);
break;
- case ProtectionSpaceAuthenticationSchemeHTTPDigest:
+ case ProtectionSpace::AuthenticationScheme::HTTPDigest:
*result = SysAllocString(WebURLAuthenticationMethodHTTPDigest);
break;
- case ProtectionSpaceAuthenticationSchemeHTMLForm:
+ case ProtectionSpace::AuthenticationScheme::HTMLForm:
*result = SysAllocString(WebURLAuthenticationMethodHTMLForm);
break;
default:
@@ -131,17 +131,17 @@
return S_OK;
}
-static ProtectionSpaceAuthenticationScheme coreScheme(BSTR authenticationMethod)
+static ProtectionSpace::AuthenticationScheme coreScheme(BSTR authenticationMethod)
{
- ProtectionSpaceAuthenticationScheme scheme = ProtectionSpaceAuthenticationSchemeDefault;
+ auto scheme = ProtectionSpace::AuthenticationScheme::Default;
if (BString(authenticationMethod) == BString(WebURLAuthenticationMethodDefault))
- scheme = ProtectionSpaceAuthenticationSchemeDefault;
+ scheme = ProtectionSpace::AuthenticationScheme::Default;
else if (BString(authenticationMethod) == BString(WebURLAuthenticationMethodHTTPBasic))
- scheme = ProtectionSpaceAuthenticationSchemeHTTPBasic;
+ scheme = ProtectionSpace::AuthenticationScheme::HTTPBasic;
else if (BString(authenticationMethod) == BString(WebURLAuthenticationMethodHTTPDigest))
- scheme = ProtectionSpaceAuthenticationSchemeHTTPDigest;
+ scheme = ProtectionSpace::AuthenticationScheme::HTTPDigest;
else if (BString(authenticationMethod) == BString(WebURLAuthenticationMethodHTMLForm))
- scheme = ProtectionSpaceAuthenticationSchemeHTMLForm;
+ scheme = ProtectionSpace::AuthenticationScheme::HTMLForm;
else
ASSERT_NOT_REACHED();
return scheme;
@@ -154,15 +154,15 @@
static BString& webURLProtectionSpaceFTPBString = *new BString(WebURLProtectionSpaceFTP);
static BString& webURLProtectionSpaceFTPSBString = *new BString(WebURLProtectionSpaceFTPS);
- ProtectionSpaceServerType serverType = ProtectionSpaceServerHTTP;
+ auto serverType = ProtectionSpace::ServerType::HTTP;
if (BString(protocol) == webURLProtectionSpaceHTTPBString)
- serverType = ProtectionSpaceServerHTTP;
+ serverType = ProtectionSpace::ServerType::HTTP;
else if (BString(protocol) == webURLProtectionSpaceHTTPSBString)
- serverType = ProtectionSpaceServerHTTPS;
+ serverType = ProtectionSpace::ServerType::HTTPS;
else if (BString(protocol) == webURLProtectionSpaceFTPBString)
- serverType = ProtectionSpaceServerFTP;
+ serverType = ProtectionSpace::ServerType::FTP;
else if (BString(protocol) == webURLProtectionSpaceFTPSBString)
- serverType = ProtectionSpaceServerFTPS;
+ serverType = ProtectionSpace::ServerType::FTPS;
m_protectionSpace = ProtectionSpace(String(host, SysStringLen(host)), port, serverType,
String(realm, SysStringLen(realm)), coreScheme(authenticationMethod));
@@ -177,15 +177,15 @@
static BString& webURLProtectionSpaceFTPProxyBString = *new BString(WebURLProtectionSpaceFTPProxy);
static BString& webURLProtectionSpaceSOCKSProxyBString = *new BString(WebURLProtectionSpaceSOCKSProxy);
- ProtectionSpaceServerType serverType = ProtectionSpaceProxyHTTP;
+ auto serverType = ProtectionSpace::ServerType::ProxyHTTP;
if (BString(proxyType) == webURLProtectionSpaceHTTPProxyBString)
- serverType = ProtectionSpaceProxyHTTP;
+ serverType = ProtectionSpace::ServerType::ProxyHTTP;
else if (BString(proxyType) == webURLProtectionSpaceHTTPSProxyBString)
- serverType = ProtectionSpaceProxyHTTPS;
+ serverType = ProtectionSpace::ServerType::ProxyHTTPS;
else if (BString(proxyType) == webURLProtectionSpaceFTPProxyBString)
- serverType = ProtectionSpaceProxyFTP;
+ serverType = ProtectionSpace::ServerType::ProxyFTP;
else if (BString(proxyType) == webURLProtectionSpaceSOCKSProxyBString)
- serverType = ProtectionSpaceProxySOCKS;
+ serverType = ProtectionSpace::ServerType::ProxySOCKS;
else
ASSERT_NOT_REACHED();
@@ -217,16 +217,16 @@
return E_POINTER;
switch (m_protectionSpace.serverType()) {
- case ProtectionSpaceServerHTTP:
+ case ProtectionSpace::ServerType::HTTP:
*result = SysAllocString(WebURLProtectionSpaceHTTP);
break;
- case ProtectionSpaceServerHTTPS:
+ case ProtectionSpace::ServerType::HTTPS:
*result = SysAllocString(WebURLProtectionSpaceHTTPS);
break;
- case ProtectionSpaceServerFTP:
+ case ProtectionSpace::ServerType::FTP:
*result = SysAllocString(WebURLProtectionSpaceFTP);
break;
- case ProtectionSpaceServerFTPS:
+ case ProtectionSpace::ServerType::FTPS:
*result = SysAllocString(WebURLProtectionSpaceFTPS);
break;
default:
@@ -242,16 +242,16 @@
return E_POINTER;
switch (m_protectionSpace.serverType()) {
- case ProtectionSpaceProxyHTTP:
+ case ProtectionSpace::ServerType::ProxyHTTP:
*result = SysAllocString(WebURLProtectionSpaceHTTPProxy);
break;
- case ProtectionSpaceProxyHTTPS:
+ case ProtectionSpace::ServerType::ProxyHTTPS:
*result = SysAllocString(WebURLProtectionSpaceHTTPSProxy);
break;
- case ProtectionSpaceProxyFTP:
+ case ProtectionSpace::ServerType::ProxyFTP:
*result = SysAllocString(WebURLProtectionSpaceFTPProxy);
break;
- case ProtectionSpaceProxySOCKS:
+ case ProtectionSpace::ServerType::ProxySOCKS:
*result = SysAllocString(WebURLProtectionSpaceSOCKSProxy);
break;
default: