Commit 2ab1e6a4 authored by ap@apple.com's avatar ap@apple.com

Reviewed by Dan Bernstein.

        https://bugs.webkit.org/show_bug.cgi?id=31312
        Decouple authentication panel callbacks from ResourceHandle

        No change in functionality.

        SocketStreamHandle also needs to request credentials, so it's not appropriate to store
        ResourceHandle as delegate.

WebCore:
        * WebCore.vcproj/WebCore.vcproj:
        * platform/network/AuthenticationClient.h: Added.
        Added a new interface for listening to authentication panel notifications.

        * WebCore.xcodeproj/project.pbxproj: Added AuthenticationClient.h. Let Visual Studio do what
        it wants with the project file.

        (WebCore::AuthenticationClient::ref): Using our usual method of exposing refcounting on an
        interface class.
        (WebCore::AuthenticationClient::deref): Ditto.

        * platform/network/ResourceHandle.h:
        (WebCore::ResourceHandle::refAuthenticationClient): Ditto.
        (WebCore::ResourceHandle::derefAuthenticationClient): Ditto.

        * platform/network/cf/AuthenticationCF.cpp:
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        (WebCore::AuthenticationChallenge::platformCompare):
        * platform/network/cf/AuthenticationChallenge.h:
        (WebCore::AuthenticationChallenge::authenticationClient):
        * platform/network/chromium/AuthenticationChallenge.h:
        (WebCore::AuthenticationChallenge::authenticationClient):
        * platform/network/curl/AuthenticationChallenge.h:
        (WebCore::AuthenticationChallenge::authenticationClient):
        Keeping a reference to AuthenticationClient, not to ResourceHandle.

WebKit:
        * WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
        * WebURLAuthenticationChallenge.cpp:
        (WebURLAuthenticationChallenge::initWithAuthenticationChallenge):
        (WebURLAuthenticationChallenge::sender):
        * WebURLAuthenticationChallengeSender.cpp:
        (WebURLAuthenticationChallengeSender::WebURLAuthenticationChallengeSender):
        (WebURLAuthenticationChallengeSender::createInstance):
        (WebURLAuthenticationChallengeSender::authenticationClient):
        * WebURLAuthenticationChallengeSender.h:
        * WebURLAuthenticationChallengeSenderCFNet.cpp:
        (WebURLAuthenticationChallengeSender::cancelAuthenticationChallenge):
        (WebURLAuthenticationChallengeSender::continueWithoutCredentialForAuthenticationChallenge):
        (WebURLAuthenticationChallengeSender::useCredential):
        Adjusted for WebCore changes.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 98c947b9
2009-11-10 Alexey Proskuryakov <ap@apple.com>
Reviewed by Dan Bernstein.
https://bugs.webkit.org/show_bug.cgi?id=31312
Decouple authentication panel callbacks from ResourceHandle
No change in functionality.
SocketStreamHandle also needs to request credentials, so it's not appropriate to store
ResourceHandle as delegate.
* WebCore.vcproj/WebCore.vcproj:
* platform/network/AuthenticationClient.h: Added.
Added a new interface for listening to authentication panel notifications.
* WebCore.xcodeproj/project.pbxproj: Added AuthenticationClient.h. Let Visual Studio do what
it wants with the project file.
(WebCore::AuthenticationClient::ref): Using our usual method of exposing refcounting on an
interface class.
(WebCore::AuthenticationClient::deref): Ditto.
* platform/network/ResourceHandle.h:
(WebCore::ResourceHandle::refAuthenticationClient): Ditto.
(WebCore::ResourceHandle::derefAuthenticationClient): Ditto.
* platform/network/cf/AuthenticationCF.cpp:
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::AuthenticationChallenge::platformCompare):
* platform/network/cf/AuthenticationChallenge.h:
(WebCore::AuthenticationChallenge::authenticationClient):
* platform/network/chromium/AuthenticationChallenge.h:
(WebCore::AuthenticationChallenge::authenticationClient):
* platform/network/curl/AuthenticationChallenge.h:
(WebCore::AuthenticationChallenge::authenticationClient):
Keeping a reference to AuthenticationClient, not to ResourceHandle.
2009-11-10 Beth Dakin <bdakin@apple.com>
Second attempted gtk build fix. No review needed.
......@@ -1584,6 +1584,7 @@ webcore_sources += \
WebCore/platform/graphics/transforms/TranslateTransformOperation.h \
WebCore/platform/network/AuthenticationChallengeBase.cpp \
WebCore/platform/network/AuthenticationChallengeBase.h \
WebCore/platform/network/AuthenticationClient.h \
WebCore/platform/network/Credential.cpp \
WebCore/platform/network/Credential.h \
WebCore/platform/network/DNS.h \
......
......@@ -2442,6 +2442,7 @@
'platform/network/win/ResourceHandleWin.h',
'platform/network/AuthenticationChallengeBase.cpp',
'platform/network/AuthenticationChallengeBase.h',
'platform/network/AuthenticationClient.h',
'platform/network/Credential.cpp',
'platform/network/Credential.h',
'platform/network/DNS.h',
......
......@@ -1920,6 +1920,7 @@ HEADERS += \
platform/Logging.h \
platform/MIMETypeRegistry.h \
platform/network/AuthenticationChallengeBase.h \
platform/network/AuthenticationClient.h \
platform/network/Credential.h \
platform/network/FormDataBuilder.h \
platform/network/FormData.h \
......
......@@ -7720,6 +7720,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
>
......@@ -7772,10 +7776,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.h"
>
......@@ -23969,6 +23969,10 @@
RelativePath="..\platform\network\AuthenticationChallengeBase.h"
>
</File>
<File
RelativePath="..\platform\network\AuthenticationClient.h"
>
</File>
<File
RelativePath="..\platform\network\Credential.cpp"
>
......@@ -34576,94 +34580,10 @@
<File
RelativePath="..\bindings\js\JSCustomPositionCallback.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Internal|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Cairo|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Cairo|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_All|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\bindings\js\JSCustomPositionErrorCallback.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Internal|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Cairo|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Cairo|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_All|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\bindings\js\JSCustomSQLStatementCallback.cpp"
......@@ -36080,48 +36000,6 @@
<File
RelativePath="..\bindings\js\JSGeolocationCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Internal|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Cairo|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Cairo|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_All|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\bindings\js\JSHistoryCustom.cpp"
......
......@@ -4603,6 +4603,7 @@
E10B9CCD0B747A44003ED890 /* DOMCustomXPathNSResolver.mm in Sources */ = {isa = PBXBuildFile; fileRef = E10B9CCB0B747A44003ED890 /* DOMCustomXPathNSResolver.mm */; };
E11C9D9B0EB3681200E409DB /* ScriptExecutionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E11C9D9A0EB3681200E409DB /* ScriptExecutionContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
E11C9DB00EB3699500E409DB /* ScriptExecutionContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E11C9DAF0EB3699500E409DB /* ScriptExecutionContext.cpp */; };
E124748410AA161D00B79493 /* AuthenticationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E124748310AA161D00B79493 /* AuthenticationClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
E12719C70EEEC16800F61213 /* NavigatorBase.h in Headers */ = {isa = PBXBuildFile; fileRef = E12719C60EEEC16800F61213 /* NavigatorBase.h */; };
E12719CA0EEEC21300F61213 /* NavigatorBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E12719C90EEEC21300F61213 /* NavigatorBase.cpp */; };
E1271A0B0EEEC77A00F61213 /* WorkerNavigator.h in Headers */ = {isa = PBXBuildFile; fileRef = E1271A0A0EEEC77A00F61213 /* WorkerNavigator.h */; };
......@@ -9764,6 +9765,7 @@
E10B9CCB0B747A44003ED890 /* DOMCustomXPathNSResolver.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMCustomXPathNSResolver.mm; sourceTree = "<group>"; };
E11C9D9A0EB3681200E409DB /* ScriptExecutionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptExecutionContext.h; sourceTree = "<group>"; };
E11C9DAF0EB3699500E409DB /* ScriptExecutionContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptExecutionContext.cpp; sourceTree = "<group>"; };
E124748310AA161D00B79493 /* AuthenticationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationClient.h; sourceTree = "<group>"; };
E12719C60EEEC16800F61213 /* NavigatorBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorBase.h; sourceTree = "<group>"; };
E12719C90EEEC21300F61213 /* NavigatorBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorBase.cpp; sourceTree = "<group>"; };
E1271A0A0EEEC77A00F61213 /* WorkerNavigator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerNavigator.h; sourceTree = "<group>"; };
......@@ -10994,6 +10996,7 @@
656B84E70AEA1DAE00A095B4 /* mac */,
934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */,
934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */,
E124748310AA161D00B79493 /* AuthenticationClient.h */,
514C76580CE923A1007EF3CD /* Credential.cpp */,
514C76590CE923A1007EF3CD /* Credential.h */,
51A052321058774F00CC9E95 /* CredentialStorage.cpp */,
......@@ -18102,6 +18105,7 @@
1479FAF0109AE37500DED655 /* RenderRubyBase.h in Headers */,
1479FAF2109AE37500DED655 /* RenderRubyRun.h in Headers */,
1479FAF4109AE37500DED655 /* RenderRubyText.h in Headers */,
E124748410AA161D00B79493 /* AuthenticationClient.h in Headers */,
9382DF5810A8D5C900925652 /* ColorSpace.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AuthenticationClient_h
#define AuthenticationClient_h
namespace WebCore {
class AuthenticationChallenge;
class Credential;
class AuthenticationClient {
public:
virtual void receivedCredential(const AuthenticationChallenge&, const Credential&) = 0;
virtual void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&) = 0;
virtual void receivedCancellation(const AuthenticationChallenge&) = 0;
void ref() { refAuthenticationClient(); }
void deref() { derefAuthenticationClient(); }
protected:
virtual ~AuthenticationClient() { }
private:
virtual void refAuthenticationClient() = 0;
virtual void derefAuthenticationClient() = 0;
};
}
#endif
......@@ -27,6 +27,7 @@
#define ResourceHandle_h
#include "AuthenticationChallenge.h"
#include "AuthenticationClient.h"
#include "HTTPHeaderMap.h"
#include "ThreadableLoader.h"
#include <wtf/OwnPtr.h>
......@@ -91,7 +92,7 @@ class SharedBuffer;
template <typename T> class Timer;
class ResourceHandle : public RefCounted<ResourceHandle> {
class ResourceHandle : public RefCounted<ResourceHandle>, public AuthenticationClient {
private:
ResourceHandle(const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, bool mightDownloadFromHandle);
......@@ -118,9 +119,9 @@ public:
#endif
#if PLATFORM(MAC) || USE(CFNETWORK) || USE(CURL)
void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
void receivedCredential(const AuthenticationChallenge&, const Credential&);
void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
void receivedCancellation(const AuthenticationChallenge&);
virtual void receivedCredential(const AuthenticationChallenge&, const Credential&);
virtual void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
virtual void receivedCancellation(const AuthenticationChallenge&);
#endif
#if PLATFORM(MAC)
......@@ -190,11 +191,17 @@ public:
void fireFailure(Timer<ResourceHandle>*);
using RefCounted<ResourceHandle>::ref;
using RefCounted<ResourceHandle>::deref;
private:
void scheduleFailure(FailureType);
bool start(Frame*);
virtual void refAuthenticationClient() { ref(); }
virtual void derefAuthenticationClient() { deref(); }
friend class ResourceHandleInternal;
OwnPtr<ResourceHandleInternal> d;
};
......
......@@ -27,9 +27,9 @@
#include "AuthenticationCF.h"
#include "AuthenticationChallenge.h"
#include "AuthenticationClient.h"
#include "Credential.h"
#include "ProtectionSpace.h"
#include "ResourceHandle.h"
#include <CFNetwork/CFURLAuthChallengePriv.h>
#include <CFNetwork/CFURLCredentialPriv.h>
......@@ -51,20 +51,20 @@ AuthenticationChallenge::AuthenticationChallenge(const ProtectionSpace& protecti
}
AuthenticationChallenge::AuthenticationChallenge(CFURLAuthChallengeRef cfChallenge,
ResourceHandle* sourceHandle)
AuthenticationClient* authenticationClient)
: AuthenticationChallengeBase(core(CFURLAuthChallengeGetProtectionSpace(cfChallenge)),
core(CFURLAuthChallengeGetProposedCredential(cfChallenge)),
CFURLAuthChallengeGetPreviousFailureCount(cfChallenge),
(CFURLResponseRef)CFURLAuthChallengeGetFailureResponse(cfChallenge),
CFURLAuthChallengeGetError(cfChallenge))
, m_sourceHandle(sourceHandle)
, m_authenticationClient(authenticationClient)
, m_cfChallenge(cfChallenge)
{
}
bool AuthenticationChallenge::platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b)
{
if (a.sourceHandle() != b.sourceHandle())
if (a.authenticationClient() != b.authenticationClient())
return false;
if (a.cfURLAuthChallengeRef() != b.cfURLAuthChallengeRef())
......
......@@ -26,29 +26,27 @@
#define AuthenticationChallenge_h
#include "AuthenticationChallengeBase.h"
#include "ResourceHandle.h"
#include "AuthenticationClient.h"
#include <wtf/RefPtr.h>
typedef struct _CFURLAuthChallenge* CFURLAuthChallengeRef;
namespace WebCore {
class ResourceHandle;
class AuthenticationChallenge : public AuthenticationChallengeBase {
public:
AuthenticationChallenge() {}
AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error);
AuthenticationChallenge(CFURLAuthChallengeRef, ResourceHandle* sourceHandle);
AuthenticationChallenge(CFURLAuthChallengeRef, AuthenticationClient*);
ResourceHandle* sourceHandle() const { return m_sourceHandle.get(); }
AuthenticationClient* authenticationClient() const { return m_authenticationClient.get(); }
CFURLAuthChallengeRef cfURLAuthChallengeRef() const { return m_cfChallenge.get(); }
private:
friend class AuthenticationChallengeBase;
static bool platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b);
RefPtr<ResourceHandle> m_sourceHandle;
RefPtr<AuthenticationClient> m_authenticationClient;
RetainPtr<CFURLAuthChallengeRef> m_cfChallenge;
};
......
......@@ -28,25 +28,23 @@
#define AuthenticationChallenge_h
#include "AuthenticationChallengeBase.h"
#include "ResourceHandle.h"
#include "AuthenticationClient.h"
#include <wtf/RefPtr.h>
namespace WebCore {
class ResourceHandle;
class AuthenticationChallenge : public AuthenticationChallengeBase {
public:
AuthenticationChallenge() {}
AuthenticationChallenge(const ProtectionSpace&, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse&, const ResourceError&);
ResourceHandle* sourceHandle() const { return m_sourceHandle.get(); }
AuthenticationClient* authenticationClient() const { return m_authenticationClient.get(); }
private:
friend class AuthenticationChallengeBase;
static bool platformCompare(const AuthenticationChallenge&, const AuthenticationChallenge&);
RefPtr<ResourceHandle> m_sourceHandle;
RefPtr<AuthenticationClient> m_authenticationClient;
};
} // namespace WebCore
......
......@@ -26,13 +26,11 @@
#define AuthenticationChallenge_h
#include "AuthenticationChallengeBase.h"
#include "ResourceHandle.h"
#include "AuthenticationClient.h"
#include <wtf/RefPtr.h>
namespace WebCore {
class ResourceHandle;
class AuthenticationChallenge : public AuthenticationChallengeBase {
public:
AuthenticationChallenge()
......@@ -44,9 +42,9 @@ public:
{
}
ResourceHandle* sourceHandle() const { return m_sourceHandle.get(); }
AuthenticationClient* authenticationClient() const { return m_authenticationClient.get(); }
RefPtr<ResourceHandle> m_sourceHandle;
RefPtr<AuthenticationClient> m_authenticationClient;
};
}
......
2009-11-10 Alexey Proskuryakov <ap@apple.com>
Reviewed by Dan Bernstein.
https://bugs.webkit.org/show_bug.cgi?id=31312
Decouple authentication panel callbacks from ResourceHandle
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
* WebURLAuthenticationChallenge.cpp:
(WebURLAuthenticationChallenge::initWithAuthenticationChallenge):
(WebURLAuthenticationChallenge::sender):
* WebURLAuthenticationChallengeSender.cpp:
(WebURLAuthenticationChallengeSender::WebURLAuthenticationChallengeSender):
(WebURLAuthenticationChallengeSender::createInstance):
(WebURLAuthenticationChallengeSender::authenticationClient):
* WebURLAuthenticationChallengeSender.h:
* WebURLAuthenticationChallengeSenderCFNet.cpp:
(WebURLAuthenticationChallengeSender::cancelAuthenticationChallenge):
(WebURLAuthenticationChallengeSender::continueWithoutCredentialForAuthenticationChallenge):
(WebURLAuthenticationChallengeSender::useCredential):
Adjusted for WebCore changes.
2009-11-10 Brian Weinstein <bweinstein@apple.com>
Reviewed by NOBODY - Build Fix.
......
......@@ -143,7 +143,7 @@ bool WebFrameLoaderClient::shouldUseCredentialStorage(DocumentLoader* loader, un
void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader* loader, unsigned long identifier, const AuthenticationChallenge& challenge)
{
#if USE(CFNETWORK)
ASSERT(challenge.sourceHandle());
ASSERT(challenge.authenticationClient());
WebView* webView = m_webFrame->webView();
COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
......@@ -155,7 +155,7 @@ void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoa
// If the ResourceLoadDelegate doesn't exist or fails to handle the call, we tell the ResourceHandle
// to continue without credential - this is the best approximation of Mac behavior
challenge.sourceHandle()->receivedRequestToContinueWithoutCredential(challenge);
challenge.authenticationClient()->receivedRequestToContinueWithoutCredential(challenge);
#else
notImplemented();
#endif
......
......@@ -172,7 +172,7 @@ HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallenge::initWithAuthenticationC
return E_NOINTERFACE;
#if USE(CFNETWORK)
m_authenticationChallenge = AuthenticationChallenge(webChallenge->authenticationChallenge().cfURLAuthChallengeRef(), webSender->resourceHandle());
m_authenticationChallenge = AuthenticationChallenge(webChallenge->authenticationChallenge().cfURLAuthChallengeRef(), webSender->authenticationClient());
return S_OK;
#else
......@@ -220,8 +220,8 @@ HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallenge::sender(
/* [out, retval] */ IWebURLAuthenticationChallengeSender** sender)
{
if (!m_sender) {
ResourceHandle* handle = m_authenticationChallenge.sourceHandle();
m_sender.adoptRef(WebURLAuthenticationChallengeSender::createInstance(handle));
AuthenticationClient* client = m_authenticationChallenge.authenticationClient();
m_sender.adoptRef(WebURLAuthenticationChallengeSender::createInstance(client));
}
return m_sender.copyRefTo(sender);
......
......@@ -34,18 +34,18 @@
#include "WebURLCredential.h"
#pragma warning(push, 0)
#include <WebCore/ResourceHandle.h>
#include <WebCore/AuthenticationClient.h>
#pragma warning(pop)
using namespace WebCore;
// WebURLAuthenticationChallengeSender ----------------------------------------------------------------
WebURLAuthenticationChallengeSender::WebURLAuthenticationChallengeSender(PassRefPtr<ResourceHandle> handle)
WebURLAuthenticationChallengeSender::WebURLAuthenticationChallengeSender(PassRefPtr<AuthenticationClient> client)
: m_refCount(0)
, m_handle(handle)
, m_client(client)
{
ASSERT(m_handle);
ASSERT(m_client);
gClassCount++;
gClassNameCount.add("WebURLAuthenticationChallengeSender");
}
......@@ -56,9 +56,9 @@ WebURLAuthenticationChallengeSender::~WebURLAuthenticationChallengeSender()
gClassNameCount.remove("WebURLAuthenticationChallengeSender");
}
WebURLAuthenticationChallengeSender* WebURLAuthenticationChallengeSender::createInstance(PassRefPtr<WebCore::ResourceHandle> handle)
WebURLAuthenticationChallengeSender* WebURLAuthenticationChallengeSender::createInstance(PassRefPtr<WebCore::AuthenticationClient> client)
{
WebURLAuthenticationChallengeSender* instance = new WebURLAuthenticationChallengeSender(handle);
WebURLAuthenticationChallengeSender* instance = new WebURLAuthenticationChallengeSender(client);
instance->AddRef();
return instance;
}
......@@ -97,8 +97,8 @@ ULONG STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::Release(void)
// WebURLAuthenticationChallengeSender ----------------------------------------------------------------
ResourceHandle* WebURLAuthenticationChallengeSender::resourceHandle() const
AuthenticationClient* WebURLAuthenticationChallengeSender::authenticationClient() const
{
return m_handle.get();
return m_client.get();
}
......@@ -32,16 +32,16 @@
#include <wtf/RefPtr.h>
namespace WebCore {
class ResourceHandle;
class AuthenticationClient;
}
class DECLSPEC_UUID("5CACD637-F82F-491F-947A-5DCA38AA0FEA") WebURLAuthenticationChallengeSender
: public IWebURLAuthenticationChallengeSender
{
public:
static WebURLAuthenticationChallengeSender* createInstance(PassRefPtr<WebCore::ResourceHandle>);
static WebURLAuthenticationChallengeSender* createInstance(PassRefPtr<WebCore::AuthenticationClient>);
private:
WebURLAuthenticationChallengeSender(PassRefPtr<WebCore::ResourceHandle>);
WebURLAuthenticationChallengeSender(PassRefPtr<WebCore::AuthenticationClient>);
~WebURLAuthenticationChallengeSender();
public:
// IUnknown
......@@ -60,12 +60,12 @@ public:
/* [in] */ IWebURLCredential* credential,
/* [in] */ IWebURLAuthenticationChallenge* challenge);
WebCore::ResourceHandle* resourceHandle() const;
WebCore::AuthenticationClient* authenticationClient() const;
private:
ULONG m_refCount;
RefPtr<WebCore::ResourceHandle> m_handle;
RefPtr<WebCore::AuthenticationClient> m_client;
};
#endif
......@@ -34,7 +34,7 @@
#include "WebURLCredential.h"
#pragma warning(push, 0)
#include <WebCore/ResourceHandle.h>
#include <WebCore/AuthenticationClient.h>
#pragma warning(pop)
using namespace WebCore;
......@@ -48,7 +48,7 @@ HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::cancelAuthenticat
if (!webChallenge)
return E_FAIL;
m_handle->receivedCancellation(webChallenge->authenticationChallenge());
m_client->receivedCancellation(webChallenge->authenticationChallenge());
return S_OK;
}
......@@ -59,7 +59,7 @@ HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::continueWithoutCr
if (!webChallenge)
return E_FAIL;
m_handle->receivedRequestToContinueWithoutCredential(webChallenge->authenticationChallenge());
m_client->receivedRequestToContinueWithoutCredential(webChallenge->authenticationChallenge());
return S_OK;
}
......@@ -75,6 +75,6 @@ HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallengeSender::useCredential(
if (!credential || FAILED(credential->QueryInterface(__uuidof(WebURLCredential), (void**)&webCredential)))