Changeset 115104 in webkit


Ignore:
Timestamp:
Apr 24, 2012 1:52:51 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Revert broken changes to authentication dialog
https://bugs.webkit.org/show_bug.cgi?id=80135

Patch by Joe Mason <jmason@rim.com> on 2012-04-24
Reviewed by Antonio Gomes.

The previous patches from this bug caused an infinite loop when using digest auth;
apparently they were only tested with basic.

Source/WebCore:

  • platform/blackberry/PageClientBlackBerry.h:
  • platform/network/blackberry/NetworkJob.cpp:

(WebCore::NetworkJob::handleAuthHeader):
(WebCore::NetworkJob::sendRequestWithCredentials):

Source/WebKit/blackberry:

  • Api/DumpRenderTreeClient.h:
  • Api/WebPage.cpp:

(BlackBerry::WebKit::WebPagePrivate::authenticationChallenge):

  • Api/WebPageClient.h:
  • Api/WebPage_p.h:

(WebPagePrivate):

Tools:

  • DumpRenderTree/blackberry/DumpRenderTree.cpp:
  • DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:

(WebCore):

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r115102 r115104  
     12012-04-24  Joe Mason  <jmason@rim.com>
     2
     3        [BlackBerry] Revert broken changes to authentication dialog
     4        https://bugs.webkit.org/show_bug.cgi?id=80135
     5
     6        Reviewed by Antonio Gomes.
     7
     8        The previous patches from this bug caused an infinite loop when using digest auth;
     9        apparently they were only tested with basic.
     10
     11        * platform/blackberry/PageClientBlackBerry.h:
     12        * platform/network/blackberry/NetworkJob.cpp:
     13        (WebCore::NetworkJob::handleAuthHeader):
     14        (WebCore::NetworkJob::sendRequestWithCredentials):
     15
    1162012-04-24  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    217
  • trunk/Source/WebCore/platform/blackberry/PageClientBlackBerry.h

    r114493 r115104  
    7171    virtual bool isActive() const = 0;
    7272    virtual bool isVisible() const = 0;
    73     virtual bool authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, WebCore::Credential&) = 0;
     73    virtual WebCore::Credential authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&) = 0;
    7474    virtual SaveCredentialType notifyShouldSaveCredential(bool) = 0;
    7575};
  • trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp

    r114235 r115104  
    742742        return false;
    743743
     744    if (!m_handle->getInternal()->m_currentWebChallenge.isNull())
     745        return false;
     746
    744747    if (header.isEmpty())
    745748        return false;
     
    850853        String password;
    851854
     855        if (!m_frame || !m_frame->loader() || !m_frame->loader()->client())
     856            return false;
     857
    852858        // Before asking the user for credentials, we check if the URL contains that.
    853859        if (!m_handle->getInternal()->m_user.isEmpty() && !m_handle->getInternal()->m_pass.isEmpty()) {
     
    860866            m_handle->getInternal()->m_pass = "";
    861867        } else {
    862             Credential inputCredential;
    863             bool isConfirmed = m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace, inputCredential);
     868            Credential inputCredential = m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace);
    864869            username = inputCredential.user();
    865870            password = inputCredential.password();
    866 
    867             if (!isConfirmed)
    868                 return false;
    869         }
     871        }
     872
     873        if (username.isEmpty() && password.isEmpty())
     874            return false;
    870875
    871876        credential = Credential(username, password, CredentialPersistenceForSession);
  • trunk/Source/WebKit/blackberry/Api/DumpRenderTreeClient.h

    r114263 r115104  
    2626
    2727namespace WebCore {
    28 class Credential;
    2928class Frame;
    3029class DOMWrapperWorld;
     
    8382    virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, int insertAction) = 0;
    8483    virtual bool isSelectTrailingWhitespaceEnabled() const = 0;
    85     virtual bool didReceiveAuthenticationChallenge(WebCore::Credential&) = 0;
    8684
    8785};
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r114779 r115104  
    20402040}
    20412041
    2042 bool WebPagePrivate::authenticationChallenge(const KURL& url, const ProtectionSpace& protectionSpace, Credential& inputCredential)
     2042Credential WebPagePrivate::authenticationChallenge(const KURL& url, const ProtectionSpace& protectionSpace)
    20432043{
    20442044    WebString username;
    20452045    WebString password;
    2046 
    2047 #if ENABLE_DRT
    2048     if (m_dumpRenderTree)
    2049         return m_dumpRenderTree->didReceiveAuthenticationChallenge(inputCredential);
    2050 #endif
    20512046
    20522047#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
     
    20552050#endif
    20562051
    2057     bool isConfirmed = m_client->authenticationChallenge(protectionSpace.realm().characters(), protectionSpace.realm().length(), username, password);
     2052    m_client->authenticationChallenge(protectionSpace.realm().characters(), protectionSpace.realm().length(), username, password);
    20582053
    20592054#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
    2060     Credential credential(username, password, CredentialPersistencePermanent);
     2055    Credential inputCredential(username, password, CredentialPersistencePermanent);
    20612056    if (!m_webSettings->isPrivateBrowsingEnabled())
    2062         credentialManager().saveCredentialIfConfirmed(this, CredentialTransformData(url, protectionSpace, credential));
     2057        credentialManager().saveCredentialIfConfirmed(this, CredentialTransformData(url, protectionSpace, inputCredential));
    20632058#else
    2064     Credential credential(username, password, CredentialPersistenceNone);
    2065 #endif
    2066     inputCredential = credential;
    2067     return isConfirmed;
     2059    Credential inputCredential(username, password, CredentialPersistenceNone);
     2060#endif
     2061    return inputCredential;
    20682062}
    20692063
  • trunk/Source/WebKit/blackberry/Api/WebPageClient.h

    r115066 r115104  
    212212
    213213    virtual void setPreventsScreenIdleDimming(bool noDimming) = 0;
    214     virtual bool authenticationChallenge(const unsigned short* realm, unsigned int realmLength, WebString& username, WebString& password) = 0;
     214    virtual void authenticationChallenge(const unsigned short* realm, unsigned int realmLength, WebString& username, WebString& password) = 0;
    215215    virtual SaveCredentialType notifyShouldSaveCredential(bool isNew) = 0;
    216216
  • trunk/Source/WebKit/blackberry/Api/WebPage_p.h

    r114779 r115104  
    180180    virtual bool isActive() const;
    181181    virtual bool isVisible() const { return m_visible; }
    182     virtual bool authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, WebCore::Credential&);
     182    virtual WebCore::Credential authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&);
    183183    virtual SaveCredentialType notifyShouldSaveCredential(bool);
    184184
  • trunk/Source/WebKit/blackberry/ChangeLog

    r115066 r115104  
     12012-04-24  Joe Mason  <jmason@rim.com>
     2
     3        [BlackBerry] Revert broken changes to authentication dialog
     4        https://bugs.webkit.org/show_bug.cgi?id=80135
     5
     6        Reviewed by Antonio Gomes.
     7
     8        The previous patches from this bug caused an infinite loop when using digest auth;
     9        apparently they were only tested with basic.
     10
     11        * Api/DumpRenderTreeClient.h:
     12        * Api/WebPage.cpp:
     13        (BlackBerry::WebKit::WebPagePrivate::authenticationChallenge):
     14        * Api/WebPageClient.h:
     15        * Api/WebPage_p.h:
     16        (WebPagePrivate):
     17
    1182012-04-24  Mike Fenton  <mifenton@rim.com>
    219
  • trunk/Tools/ChangeLog

    r115094 r115104  
     12012-04-24  Joe Mason  <jmason@rim.com>
     2
     3        [BlackBerry] Revert broken changes to authentication dialog
     4        https://bugs.webkit.org/show_bug.cgi?id=80135
     5
     6        Reviewed by Antonio Gomes.
     7
     8        The previous patches from this bug caused an infinite loop when using digest auth;
     9        apparently they were only tested with basic.
     10
     11        * DumpRenderTree/blackberry/DumpRenderTree.cpp:
     12        * DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:
     13        (WebCore):
     14
    1152012-04-24  Zan Dobersek  <zandobersek@gmail.com>
    216
  • trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp

    r114488 r115104  
    2424#include "BackForwardListImpl.h"
    2525#include "CString.h"
    26 #include "Credential.h"
    2726#include "DatabaseTracker.h"
    2827#include "DocumentLoader.h"
     
    123122}
    124123
    125 static WTF::String drtCredentialDescription(WebCore::Credential&)
    126 {
    127     return "<unknown>";
    128 }
    129 
    130124static bool shouldLogFrameLoadDelegates(const WTF::String& url)
    131125{
     
    814808}
    815809
    816 bool DumpRenderTree::didReceiveAuthenticationChallenge(WebCore::Credential& credential)
    817 {
    818     if (!gLayoutTestController->handlesAuthenticationChallenges()) {
    819         credential = WebCore::Credential();
    820         printf("%s - didReceiveAuthenticationChallenge - Simulating cancelled authentication\n", drtCredentialDescription(credential).utf8().data());
    821         return false;
    822     }
    823     const char* user = gLayoutTestController->authenticationUsername().c_str();
    824     const char* password = gLayoutTestController->authenticationPassword().c_str();
    825     credential = WebCore::Credential(user, password, WebCore::CredentialPersistenceForSession);
    826     printf("%s - didReceiveAuthenticationChallenge - Responding with %s:%s\n", drtCredentialDescription(credential).utf8().data(), user, password);
    827     return true;
    828 }
    829 
    830810}
    831811}
  • trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h

    r114263 r115104  
    2929
    3030namespace WebCore {
    31 class Credential;
     31class Frame;
    3232class DOMWrapperWorld;
    33 class Frame;
    3433class Range;
    3534}
     
    103102    bool isSelectTrailingWhitespaceEnabled() const { return s_selectTrailingWhitespaceEnabled; }
    104103    void setSelectTrailingWhitespaceEnabled(bool enabled) { s_selectTrailingWhitespaceEnabled = enabled; }
    105     bool didReceiveAuthenticationChallenge(WebCore::Credential&);
    106104
    107105private:
Note: See TracChangeset for help on using the changeset viewer.