diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/Authentication')
7 files changed, 60 insertions, 34 deletions
diff --git a/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp b/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp index 8c5d26fc7..9bdd73b44 100644 --- a/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp +++ b/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp @@ -62,15 +62,19 @@ void AuthenticationChallengeProxy::useCredential(WebCredential* credential) if (!m_challengeID) return; - if (!credential) - m_connection->send(Messages::AuthenticationManager::ContinueWithoutCredentialForChallenge(m_challengeID), 0); - else { - WebCertificateInfo* certificateInfo = credential->certificateInfo(); - WebCore::CertificateInfo platformInfo = certificateInfo ? certificateInfo->certificateInfo() : WebCore::CertificateInfo(); - m_connection->send(Messages::AuthenticationManager::UseCredentialForChallenge(m_challengeID, credential->core(), platformInfo), 0); + uint64_t challengeID = m_challengeID; + m_challengeID = 0; + + if (!credential) { + m_connection->send(Messages::AuthenticationManager::ContinueWithoutCredentialForChallenge(challengeID), 0); + return; } - m_challengeID = 0; + WebCore::CertificateInfo certificateInfo; + if (credential->certificateInfo()) + certificateInfo = credential->certificateInfo()->certificateInfo(); + + m_connection->send(Messages::AuthenticationManager::UseCredentialForChallenge(challengeID, credential->credential(), certificateInfo), 0); } void AuthenticationChallengeProxy::cancel() @@ -83,6 +87,26 @@ void AuthenticationChallengeProxy::cancel() m_challengeID = 0; } +void AuthenticationChallengeProxy::performDefaultHandling() +{ + if (!m_challengeID) + return; + + m_connection->send(Messages::AuthenticationManager::PerformDefaultHandling(m_challengeID), 0); + + m_challengeID = 0; +} + +void AuthenticationChallengeProxy::rejectProtectionSpaceAndContinue() +{ + if (!m_challengeID) + return; + + m_connection->send(Messages::AuthenticationManager::RejectProtectionSpaceAndContinue(m_challengeID), 0); + + m_challengeID = 0; +} + WebCredential* AuthenticationChallengeProxy::proposedCredential() const { if (!m_webCredential) diff --git a/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h b/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h index a549d5188..9bac83f40 100644 --- a/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h +++ b/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h @@ -43,15 +43,17 @@ class WebProtectionSpace; class AuthenticationChallengeProxy : public API::ObjectImpl<API::Object::Type::AuthenticationChallenge> { public: - static PassRefPtr<AuthenticationChallengeProxy> create(const WebCore::AuthenticationChallenge& authenticationChallenge, uint64_t challengeID, IPC::Connection* connection) + static Ref<AuthenticationChallengeProxy> create(const WebCore::AuthenticationChallenge& authenticationChallenge, uint64_t challengeID, IPC::Connection* connection) { - return adoptRef(new AuthenticationChallengeProxy(authenticationChallenge, challengeID, connection)); + return adoptRef(*new AuthenticationChallengeProxy(authenticationChallenge, challengeID, connection)); } ~AuthenticationChallengeProxy(); void useCredential(WebCredential*); void cancel(); + void performDefaultHandling(); + void rejectProtectionSpaceAndContinue(); AuthenticationDecisionListener* listener() const { return m_listener.get(); } WebCredential* proposedCredential() const; diff --git a/Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.cpp b/Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.cpp index 00cd8748c..8bde289e3 100644 --- a/Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.cpp +++ b/Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.cpp @@ -52,6 +52,18 @@ void AuthenticationDecisionListener::cancel() m_challengeProxy->cancel(); } +void AuthenticationDecisionListener::performDefaultHandling() +{ + if (m_challengeProxy) + m_challengeProxy->performDefaultHandling(); +} + +void AuthenticationDecisionListener::rejectProtectionSpaceAndContinue() +{ + if (m_challengeProxy) + m_challengeProxy->rejectProtectionSpaceAndContinue(); +} + void AuthenticationDecisionListener::detachChallenge() { m_challengeProxy = 0; diff --git a/Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.h b/Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.h index 057ddd8cd..b5bd2b09a 100644 --- a/Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.h +++ b/Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.h @@ -37,14 +37,16 @@ class WebCredential; class AuthenticationDecisionListener : public API::ObjectImpl<API::Object::Type::AuthenticationDecisionListener> { public: - static PassRefPtr<AuthenticationDecisionListener> create(AuthenticationChallengeProxy* authenticationChallenge) + static Ref<AuthenticationDecisionListener> create(AuthenticationChallengeProxy* authenticationChallenge) { - return adoptRef(new AuthenticationDecisionListener(authenticationChallenge)); + return adoptRef(*new AuthenticationDecisionListener(authenticationChallenge)); } void useCredential(WebCredential*); void cancel(); - + void performDefaultHandling(); + void rejectProtectionSpaceAndContinue(); + void detachChallenge(); private: diff --git a/Source/WebKit2/UIProcess/Authentication/WebCredential.cpp b/Source/WebKit2/UIProcess/Authentication/WebCredential.cpp index a69d509c7..a2d1d17cd 100644 --- a/Source/WebKit2/UIProcess/Authentication/WebCredential.cpp +++ b/Source/WebKit2/UIProcess/Authentication/WebCredential.cpp @@ -49,14 +49,9 @@ WebCertificateInfo* WebCredential::certificateInfo() return m_certificateInfo.get(); } -const WebCore::Credential& WebCredential::core() +const WebCore::Credential& WebCredential::credential() { return m_coreCredential; } -const String& WebCredential::user() const -{ - return m_coreCredential.user(); -} - } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/Authentication/WebCredential.h b/Source/WebKit2/UIProcess/Authentication/WebCredential.h index efff6548c..eaaa1f70c 100644 --- a/Source/WebKit2/UIProcess/Authentication/WebCredential.h +++ b/Source/WebKit2/UIProcess/Authentication/WebCredential.h @@ -29,7 +29,6 @@ #include "APIObject.h" #include "APIString.h" #include <WebCore/Credential.h> -#include <wtf/PassRefPtr.h> namespace WebKit { @@ -39,27 +38,20 @@ class WebCredential : public API::ObjectImpl<API::Object::Type::Credential> { public: ~WebCredential(); - static PassRefPtr<WebCredential> create(const WebCore::Credential& credential) + static Ref<WebCredential> create(const WebCore::Credential& credential) { - return adoptRef(new WebCredential(credential)); + return adoptRef(*new WebCredential(credential)); } - static PassRefPtr<WebCredential> create(API::String* username, API::String* password, WebCore::CredentialPersistence persistence) + static Ref<WebCredential> create(WebCertificateInfo* certificateInfo) { - return adoptRef(new WebCredential(WebCore::Credential(username->string(), password->string(), persistence))); - } - - static PassRefPtr<WebCredential> create(WebCertificateInfo* certificateInfo) - { - return adoptRef(new WebCredential(certificateInfo)); + return adoptRef(*new WebCredential(certificateInfo)); } WebCertificateInfo* certificateInfo(); - const WebCore::Credential& core(); + const WebCore::Credential& credential(); - const String& user() const; - private: explicit WebCredential(const WebCore::Credential&); explicit WebCredential(WebCertificateInfo*); diff --git a/Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.h b/Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.h index 95ad0bb57..28beba6e8 100644 --- a/Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.h +++ b/Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.h @@ -28,15 +28,14 @@ #include "APIObject.h" #include <WebCore/ProtectionSpace.h> -#include <wtf/PassRefPtr.h> namespace WebKit { class WebProtectionSpace : public API::ObjectImpl<API::Object::Type::ProtectionSpace> { public: - static PassRefPtr<WebProtectionSpace> create(const WebCore::ProtectionSpace& protectionSpace) + static Ref<WebProtectionSpace> create(const WebCore::ProtectionSpace& protectionSpace) { - return adoptRef(new WebProtectionSpace(protectionSpace)); + return adoptRef(*new WebProtectionSpace(protectionSpace)); } const String& protocol() const; |