+2007-10-02 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam.
+
+ Fix a bug discovered by app verifier where we would treat an LPCTSTR as a BSTR causing a crash.
+
+ Also rename some protection space constants and change their values to match the mac version.
+
+ * Interfaces/IWebURLAuthenticationChallenge.idl:
+ * WebURLProtectionSpace.cpp:
+ (WebURLProtectionSpace::initWithHost):
+ (WebURLProtectionSpace::initWithProxyHost):
+ (WebURLProtectionSpace::protocol):
+ (WebURLProtectionSpace::proxyType):
+
2007-09-29 Adam Roben <aroben@apple.com>
Clean-up in preparation for <rdar://5505062> WebKit's version-independent ProgIDs contain version numbers
HRESULT useCredential([in] IWebURLCredential* credential, [in] IWebURLAuthenticationChallenge* challenge);
}
-cpp_quote("#define WebURLProtectionSpaceServerHTTP TEXT(\"WebURLProtectionSpaceServerHTTP\")")
-cpp_quote("#define WebURLProtectionSpaceServerHTTPS TEXT(\"WebURLProtectionSpaceServerHTTPS\")")
-cpp_quote("#define WebURLProtectionSpaceServerFTP TEXT(\"WebURLProtectionSpaceServerFTP\")")
-cpp_quote("#define WebURLProtectionSpaceServerFTPS TEXT(\"WebURLProtectionSpaceServerFTPS\")")
-cpp_quote("#define WebURLProtectionSpaceProxyHTTP TEXT(\"WebURLProtectionSpaceProxyHTTP\")")
-cpp_quote("#define WebURLProtectionSpaceProxyHTTPS TEXT(\"WebURLProtectionSpaceProxyHTTPS\")")
-cpp_quote("#define WebURLProtectionSpaceProxyFTP TEXT(\"WebURLProtectionSpaceProxyFTP\")")
-cpp_quote("#define WebURLProtectionSpaceProxySOCKS TEXT(\"WebURLProtectionSpaceProxySOCKS\")")
+cpp_quote("#define WebURLProtectionSpaceHTTP TEXT(\"http\")")
+cpp_quote("#define WebURLProtectionSpaceHTTPS TEXT(\"https\")")
+cpp_quote("#define WebURLProtectionSpaceFTP TEXT(\"ftp\")")
+cpp_quote("#define WebURLProtectionSpaceFTPS TEXT(\"ftps\")")
+cpp_quote("#define WebURLProtectionSpaceHTTPProxy TEXT(\"http\")")
+cpp_quote("#define WebURLProtectionSpaceHTTPSProxy TEXT(\"https\")")
+cpp_quote("#define WebURLProtectionSpaceFTPProxy TEXT(\"ftp\")")
+cpp_quote("#define WebURLProtectionSpaceSOCKSProxy TEXT(\"SOCKS\")")
cpp_quote("#define WebURLAuthenticationMethodDefault TEXT(\"WebURLAuthenticationMethodDefault\")")
cpp_quote("#define WebURLAuthenticationMethodHTTPBasic TEXT(\"WebURLAuthenticationMethodHTTPBasic\")")
cpp_quote("#define WebURLAuthenticationMethodHTTPDigest TEXT(\"WebURLAuthenticationMethodHTTPDigest\")")
/* [in] */ BSTR realm,
/* [in] */ BSTR authenticationMethod)
{
- ProtectionSpaceServerType serverType = ProtectionSpaceProxyHTTP;
- if (BString(protocol) == BString(WebURLProtectionSpaceServerHTTP))
+ ProtectionSpaceServerType serverType = ProtectionSpaceServerHTTP;
+ if (BString(protocol) == WebURLProtectionSpaceHTTP)
serverType = ProtectionSpaceServerHTTP;
- else if (BString(protocol) == BString(WebURLProtectionSpaceServerHTTPS))
+ else if (BString(protocol) == WebURLProtectionSpaceHTTPS)
serverType = ProtectionSpaceServerHTTPS;
- else if (BString(protocol) == BString(WebURLProtectionSpaceServerFTP))
+ else if (BString(protocol) == WebURLProtectionSpaceFTP)
serverType = ProtectionSpaceServerFTP;
- else if (BString(protocol) == BString(WebURLProtectionSpaceServerFTPS))
+ else if (BString(protocol) == WebURLProtectionSpaceFTPS)
serverType = ProtectionSpaceServerFTPS;
else
ASSERT_NOT_REACHED();
/* [in] */ BSTR authenticationMethod)
{
ProtectionSpaceServerType serverType = ProtectionSpaceProxyHTTP;
- if (BString(proxyType) == WebURLProtectionSpaceProxyHTTP)
+ if (BString(proxyType) == WebURLProtectionSpaceHTTPProxy)
serverType = ProtectionSpaceProxyHTTP;
- else if (BString(proxyType) == WebURLProtectionSpaceProxyHTTPS)
+ else if (BString(proxyType) == WebURLProtectionSpaceHTTPSProxy)
serverType = ProtectionSpaceProxyHTTPS;
- else if (BString(proxyType) == WebURLProtectionSpaceProxyFTP)
+ else if (BString(proxyType) == WebURLProtectionSpaceFTPProxy)
serverType = ProtectionSpaceProxyFTP;
- else if (BString(proxyType) == WebURLProtectionSpaceProxySOCKS)
+ else if (BString(proxyType) == WebURLProtectionSpaceSOCKSProxy)
serverType = ProtectionSpaceProxySOCKS;
else
ASSERT_NOT_REACHED();
{
switch (m_protectionSpace.serverType()) {
case ProtectionSpaceServerHTTP:
- *result = SysAllocString(WebURLProtectionSpaceServerHTTP);
+ *result = SysAllocString(WebURLProtectionSpaceHTTP);
break;
case ProtectionSpaceServerHTTPS:
- *result = SysAllocString(WebURLProtectionSpaceServerHTTPS);
+ *result = SysAllocString(WebURLProtectionSpaceHTTPS);
break;
case ProtectionSpaceServerFTP:
- *result = SysAllocString(WebURLProtectionSpaceServerFTP);
+ *result = SysAllocString(WebURLProtectionSpaceFTP);
break;
case ProtectionSpaceServerFTPS:
- *result = SysAllocString(WebURLProtectionSpaceServerFTPS);
+ *result = SysAllocString(WebURLProtectionSpaceFTPS);
break;
default:
ASSERT_NOT_REACHED();
{
switch (m_protectionSpace.serverType()) {
case ProtectionSpaceProxyHTTP:
- *result = WebURLProtectionSpaceProxyHTTP;
+ *result = SysAllocString(WebURLProtectionSpaceHTTPProxy);
break;
case ProtectionSpaceProxyHTTPS:
- *result = WebURLProtectionSpaceProxyHTTPS;
+ *result = SysAllocString(WebURLProtectionSpaceHTTPSProxy);
break;
case ProtectionSpaceProxyFTP:
- *result = WebURLProtectionSpaceProxyFTP;
+ *result = SysAllocString(WebURLProtectionSpaceFTPProxy);
break;
case ProtectionSpaceProxySOCKS:
- *result = WebURLProtectionSpaceProxySOCKS;
+ *result = SysAllocString(WebURLProtectionSpaceSOCKSProxy);
break;
default:
ASSERT_NOT_REACHED();