Commit 24d760b8 authored by beidson's avatar beidson

WebCore:

        Reviewed by Adam
        
        CFNet additions

        * platform/network/AuthenticationChallenge.cpp:
        (WebCore::operator==):
        * platform/network/AuthenticationChallenge.h:
        (WebCore::AuthenticationChallenge::sourceHandle):
        (WebCore::AuthenticationChallenge::cfURLAuthChallengeRef):
        * platform/network/ResourceError.h:
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleInternal.h:
        (WebCore::ResourceHandleInternal::ResourceHandleInternal):


git-svn-id: svn://svn.chromium.org/blink/trunk@18880 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3a2d0c35
2007-01-15 Brady Eidson <beidson@apple.com>
Reviewed by Adam
CFNet additions
* platform/network/AuthenticationChallenge.cpp:
(WebCore::operator==):
* platform/network/AuthenticationChallenge.h:
(WebCore::AuthenticationChallenge::sourceHandle):
(WebCore::AuthenticationChallenge::cfURLAuthChallengeRef):
* platform/network/ResourceError.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
2007-01-15 Eric Seidel <eric@webkit.org> 2007-01-15 Eric Seidel <eric@webkit.org>
Reviewed by hyatt. Reviewed by hyatt.
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "config.h" #include "config.h"
#include "AuthenticationChallenge.h" #include "AuthenticationChallenge.h"
#include "ResourceHandle.h"
namespace WebCore { namespace WebCore {
AuthenticationChallenge::AuthenticationChallenge() AuthenticationChallenge::AuthenticationChallenge()
...@@ -92,6 +94,12 @@ bool operator==(const AuthenticationChallenge& a, const AuthenticationChallenge& ...@@ -92,6 +94,12 @@ bool operator==(const AuthenticationChallenge& a, const AuthenticationChallenge&
if (a.nsURLAuthenticationChallenge() != b.nsURLAuthenticationChallenge()) if (a.nsURLAuthenticationChallenge() != b.nsURLAuthenticationChallenge())
return false; return false;
#elif USE(CFNETWORK)
if (a.sourceHandle() != b.sourceHandle())
return false;
if (a.cfURLAuthChallengeRef() != b.cfURLAuthChallengeRef())
return false;
#endif #endif
if (a.protectionSpace() != b.protectionSpace()) if (a.protectionSpace() != b.protectionSpace())
......
...@@ -43,9 +43,15 @@ class NSURLAuthenticationChallenge; ...@@ -43,9 +43,15 @@ class NSURLAuthenticationChallenge;
#endif #endif
#endif #endif
#if USE(CFNETWORK)
typedef struct _CFURLAuthChallenge* CFURLAuthChallengeRef;
#endif
namespace WebCore { namespace WebCore {
class ResourceHandle;
class AuthenticationChallenge { class AuthenticationChallenge {
public: public:
...@@ -53,6 +59,8 @@ public: ...@@ -53,6 +59,8 @@ public:
AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error); AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error);
#if PLATFORM(MAC) #if PLATFORM(MAC)
AuthenticationChallenge(NSURLAuthenticationChallenge *); AuthenticationChallenge(NSURLAuthenticationChallenge *);
#elif USE(CFNETWORK)
AuthenticationChallenge(CFURLAuthChallengeRef, ResourceHandle* sourceHandle);
#endif #endif
unsigned previousFailureCount() const; unsigned previousFailureCount() const;
...@@ -67,8 +75,10 @@ public: ...@@ -67,8 +75,10 @@ public:
#if PLATFORM(MAC) #if PLATFORM(MAC)
id sender() const { return m_sender.get(); } id sender() const { return m_sender.get(); }
NSURLAuthenticationChallenge *nsURLAuthenticationChallenge() const { return m_macChallenge.get(); } NSURLAuthenticationChallenge *nsURLAuthenticationChallenge() const { return m_macChallenge.get(); }
#elif USE(CFNETWORK)
ResourceHandle* sourceHandle() const { return m_sourceHandle.get(); }
CFURLAuthChallengeRef cfURLAuthChallengeRef() const { return m_cfChallenge.get(); }
#endif #endif
private: private:
bool m_isNull; bool m_isNull;
ProtectionSpace m_protectionSpace; ProtectionSpace m_protectionSpace;
...@@ -80,6 +90,9 @@ private: ...@@ -80,6 +90,9 @@ private:
#if PLATFORM(MAC) #if PLATFORM(MAC)
RetainPtr<id> m_sender; RetainPtr<id> m_sender;
RetainPtr<NSURLAuthenticationChallenge *> m_macChallenge; RetainPtr<NSURLAuthenticationChallenge *> m_macChallenge;
#elif USE(CFNETWORK)
RefPtr<ResourceHandle> m_sourceHandle;
RetainPtr<CFURLAuthChallengeRef> m_cfChallenge;
#endif #endif
}; };
......
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
class NSError; class NSError;
#endif #endif
#if USE(CFNETWORK)
#include <CoreFoundation/CFStream.h>
#endif
namespace WebCore { namespace WebCore {
class ResourceError { class ResourceError {
...@@ -71,6 +75,8 @@ namespace WebCore { ...@@ -71,6 +75,8 @@ namespace WebCore {
, m_isNull(!error) , m_isNull(!error)
{ {
} }
#elif PLATFORM(CF)
ResourceError(CFStreamError);
#endif #endif
#if 0 #if 0
...@@ -90,6 +96,8 @@ namespace WebCore { ...@@ -90,6 +96,8 @@ namespace WebCore {
#if PLATFORM(MAC) #if PLATFORM(MAC)
operator NSError*() const; operator NSError*() const;
#elif USE(CFNETWORK)
operator CFStreamError() const;
#endif #endif
private: private:
......
...@@ -91,13 +91,14 @@ public: ...@@ -91,13 +91,14 @@ public:
~ResourceHandle(); ~ResourceHandle();
#if PLATFORM(MAC) #if PLATFORM(MAC) || USE(CFNETWORK)
void didReceiveAuthenticationChallenge(const AuthenticationChallenge&); void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
void didCancelAuthenticationChallenge(const AuthenticationChallenge&);
void receivedCredential(const AuthenticationChallenge&, const Credential&); void receivedCredential(const AuthenticationChallenge&, const Credential&);
void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&); void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
void receivedCancellation(const AuthenticationChallenge&); void receivedCancellation(const AuthenticationChallenge&);
#endif
#if PLATFORM(MAC)
void didCancelAuthenticationChallenge(const AuthenticationChallenge&);
NSURLConnection *connection() const; NSURLConnection *connection() const;
WebCoreResourceHandleAsDelegate *delegate(); WebCoreResourceHandleAsDelegate *delegate();
void releaseDelegate(); void releaseDelegate();
......
...@@ -92,6 +92,8 @@ namespace WebCore { ...@@ -92,6 +92,8 @@ namespace WebCore {
#endif #endif
#if PLATFORM(MAC) #if PLATFORM(MAC)
, m_currentMacChallenge(nil) , m_currentMacChallenge(nil)
#elif USE(CFNETWORK)
, m_currentCFChallenge(0)
#endif #endif
{ {
} }
...@@ -133,6 +135,9 @@ namespace WebCore { ...@@ -133,6 +135,9 @@ namespace WebCore {
#endif #endif
#if PLATFORM(MAC) #if PLATFORM(MAC)
NSURLAuthenticationChallenge *m_currentMacChallenge; NSURLAuthenticationChallenge *m_currentMacChallenge;
#endif
#if USE(CFNETWORK)
CFURLAuthChallengeRef m_currentCFChallenge;
#endif #endif
AuthenticationChallenge m_currentWebChallenge; AuthenticationChallenge m_currentWebChallenge;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment