[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
ap at apple.com
ap at apple.com
Thu Dec 3 13:31:33 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 9a5f37f814afa45567f0fb35f38044731c0bf01c
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 10 22:38:08 2009 +0000
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
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1312ba0..14a9cd7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,41 @@
+2009-11-10 Alexey Proskuryakov <ap at 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 at apple.com>
Second attempted gtk build fix. No review needed.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 0d3f29d..3b99419 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -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 \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index c5e1c00..bddcac2 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -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',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 29582c4..2a69373 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -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 \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index fc5e7f3..9315e35 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -7723,6 +7723,10 @@
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
>
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
+ >
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
@@ -7773,10 +7777,6 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
- >
- </File>
- <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.h"
>
</File>
@@ -23970,6 +23970,10 @@
>
</File>
<File
+ RelativePath="..\platform\network\AuthenticationClient.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\network\Credential.cpp"
>
</File>
@@ -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"
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 92a3c65..a3eeab7 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -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;
diff --git a/WebCore/platform/network/AuthenticationClient.h b/WebCore/platform/network/AuthenticationClient.h
new file mode 100644
index 0000000..1e17910
--- /dev/null
+++ b/WebCore/platform/network/AuthenticationClient.h
@@ -0,0 +1,53 @@
+/*
+ * 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
diff --git a/WebCore/platform/network/ResourceHandle.h b/WebCore/platform/network/ResourceHandle.h
index c61d8ea..3fa08e8 100644
--- a/WebCore/platform/network/ResourceHandle.h
+++ b/WebCore/platform/network/ResourceHandle.h
@@ -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;
};
diff --git a/WebCore/platform/network/cf/AuthenticationCF.cpp b/WebCore/platform/network/cf/AuthenticationCF.cpp
index bb05a39..93b62a8 100644
--- a/WebCore/platform/network/cf/AuthenticationCF.cpp
+++ b/WebCore/platform/network/cf/AuthenticationCF.cpp
@@ -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())
diff --git a/WebCore/platform/network/cf/AuthenticationChallenge.h b/WebCore/platform/network/cf/AuthenticationChallenge.h
index 9697d7e..61e0c10 100644
--- a/WebCore/platform/network/cf/AuthenticationChallenge.h
+++ b/WebCore/platform/network/cf/AuthenticationChallenge.h
@@ -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;
};
diff --git a/WebCore/platform/network/chromium/AuthenticationChallenge.h b/WebCore/platform/network/chromium/AuthenticationChallenge.h
index cd1b430..e2d1f42 100644
--- a/WebCore/platform/network/chromium/AuthenticationChallenge.h
+++ b/WebCore/platform/network/chromium/AuthenticationChallenge.h
@@ -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
diff --git a/WebCore/platform/network/curl/AuthenticationChallenge.h b/WebCore/platform/network/curl/AuthenticationChallenge.h
index a64d575..7ace096 100644
--- a/WebCore/platform/network/curl/AuthenticationChallenge.h
+++ b/WebCore/platform/network/curl/AuthenticationChallenge.h
@@ -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;
};
}
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index bf55bde..d1034b7 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,26 @@
+2009-11-10 Alexey Proskuryakov <ap at 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 at apple.com>
Reviewed by NOBODY - Build Fix.
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 0ec3f43..558348f 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -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
diff --git a/WebKit/win/WebURLAuthenticationChallenge.cpp b/WebKit/win/WebURLAuthenticationChallenge.cpp
index 7c37501..c711450 100644
--- a/WebKit/win/WebURLAuthenticationChallenge.cpp
+++ b/WebKit/win/WebURLAuthenticationChallenge.cpp
@@ -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);
diff --git a/WebKit/win/WebURLAuthenticationChallengeSender.cpp b/WebKit/win/WebURLAuthenticationChallengeSender.cpp
index 4d4d4cd..1257d41 100644
--- a/WebKit/win/WebURLAuthenticationChallengeSender.cpp
+++ b/WebKit/win/WebURLAuthenticationChallengeSender.cpp
@@ -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();
}
diff --git a/WebKit/win/WebURLAuthenticationChallengeSender.h b/WebKit/win/WebURLAuthenticationChallengeSender.h
index cfb8cc3..5ccd0c5 100644
--- a/WebKit/win/WebURLAuthenticationChallengeSender.h
+++ b/WebKit/win/WebURLAuthenticationChallengeSender.h
@@ -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
diff --git a/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp b/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp
index 21f79e0..f756391 100644
--- a/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp
+++ b/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp
@@ -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)))
return E_FAIL;
- m_handle->receivedCredential(webChallenge->authenticationChallenge(), webCredential->credential());
+ m_client->receivedCredential(webChallenge->authenticationChallenge(), webCredential->credential());
return S_OK;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list