Reviewed by Adam.
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2007 17:31:11 +0000 (17:31 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2007 17:31:11 +0000 (17:31 +0000)
        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):

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

WebKit/win/ChangeLog
WebKit/win/Interfaces/IWebURLAuthenticationChallenge.idl
WebKit/win/WebURLProtectionSpace.cpp

index 3eff9cab13f9295f6ebb94f3f0cf3e669366ff60..0582326ff7c6f837aec13e74694bcc43e16b1994 100644 (file)
@@ -1,3 +1,18 @@
+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
index b4dfe6d26ac755c2609900a8f3933d44b608548b..4908c9e623b779d4af79accff6d4c34d04b7fdfc 100644 (file)
@@ -136,14 +136,14 @@ interface IWebURLAuthenticationChallengeSender : IUnknown
     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\")")
index 1835120933400d51def9b51a1085186b958592da..9b1913c189b06a1addf7f33f4a94aa32caa8e9b7 100644 (file)
@@ -150,14 +150,14 @@ HRESULT STDMETHODCALLTYPE WebURLProtectionSpace::initWithHost(
     /* [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();
@@ -176,13 +176,13 @@ HRESULT STDMETHODCALLTYPE WebURLProtectionSpace::initWithProxyHost(
     /* [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();
@@ -212,16 +212,16 @@ HRESULT STDMETHODCALLTYPE WebURLProtectionSpace::protocol(
 {
     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();
@@ -235,16 +235,16 @@ HRESULT STDMETHODCALLTYPE WebURLProtectionSpace::proxyType(
 {
     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();