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>
Reviewed by hyatt.
......
......@@ -25,6 +25,8 @@
#include "config.h"
#include "AuthenticationChallenge.h"
#include "ResourceHandle.h"
namespace WebCore {
AuthenticationChallenge::AuthenticationChallenge()
......@@ -92,6 +94,12 @@ bool operator==(const AuthenticationChallenge& a, const AuthenticationChallenge&
if (a.nsURLAuthenticationChallenge() != b.nsURLAuthenticationChallenge())
return false;
#elif USE(CFNETWORK)
if (a.sourceHandle() != b.sourceHandle())
return false;
if (a.cfURLAuthChallengeRef() != b.cfURLAuthChallengeRef())
return false;
#endif
if (a.protectionSpace() != b.protectionSpace())
......
......@@ -43,9 +43,15 @@ class NSURLAuthenticationChallenge;
#endif
#endif
#if USE(CFNETWORK)
typedef struct _CFURLAuthChallenge* CFURLAuthChallengeRef;
#endif
namespace WebCore {
class ResourceHandle;
class AuthenticationChallenge {
public:
......@@ -53,6 +59,8 @@ public:
AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error);
#if PLATFORM(MAC)
AuthenticationChallenge(NSURLAuthenticationChallenge *);
#elif USE(CFNETWORK)
AuthenticationChallenge(CFURLAuthChallengeRef, ResourceHandle* sourceHandle);
#endif
unsigned previousFailureCount() const;
......@@ -67,8 +75,10 @@ public:
#if PLATFORM(MAC)
id sender() const { return m_sender.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
private:
bool m_isNull;
ProtectionSpace m_protectionSpace;
......@@ -80,6 +90,9 @@ private:
#if PLATFORM(MAC)
RetainPtr<id> m_sender;
RetainPtr<NSURLAuthenticationChallenge *> m_macChallenge;
#elif USE(CFNETWORK)
RefPtr<ResourceHandle> m_sourceHandle;
RetainPtr<CFURLAuthChallengeRef> m_cfChallenge;
#endif
};
......
......@@ -39,6 +39,10 @@
class NSError;
#endif
#if USE(CFNETWORK)
#include <CoreFoundation/CFStream.h>
#endif
namespace WebCore {
class ResourceError {
......@@ -71,6 +75,8 @@ namespace WebCore {
, m_isNull(!error)
{
}
#elif PLATFORM(CF)
ResourceError(CFStreamError);
#endif
#if 0
......@@ -90,6 +96,8 @@ namespace WebCore {
#if PLATFORM(MAC)
operator NSError*() const;
#elif USE(CFNETWORK)
operator CFStreamError() const;
#endif
private:
......
......@@ -91,13 +91,14 @@ public:
~ResourceHandle();
#if PLATFORM(MAC)
#if PLATFORM(MAC) || USE(CFNETWORK)
void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
void didCancelAuthenticationChallenge(const AuthenticationChallenge&);
void receivedCredential(const AuthenticationChallenge&, const Credential&);
void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
void receivedCancellation(const AuthenticationChallenge&);
#endif
#if PLATFORM(MAC)
void didCancelAuthenticationChallenge(const AuthenticationChallenge&);
NSURLConnection *connection() const;
WebCoreResourceHandleAsDelegate *delegate();
void releaseDelegate();
......
......@@ -92,6 +92,8 @@ namespace WebCore {
#endif
#if PLATFORM(MAC)
, m_currentMacChallenge(nil)
#elif USE(CFNETWORK)
, m_currentCFChallenge(0)
#endif
{
}
......@@ -133,6 +135,9 @@ namespace WebCore {
#endif
#if PLATFORM(MAC)
NSURLAuthenticationChallenge *m_currentMacChallenge;
#endif
#if USE(CFNETWORK)
CFURLAuthChallengeRef m_currentCFChallenge;
#endif
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