Changeset 111810 in webkit


Ignore:
Timestamp:
Mar 22, 2012 7:24:00 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] http authenticate dialog popup only once no matter authentication pass or fail
https://bugs.webkit.org/show_bug.cgi?id=80135

Patch by Jonathan Dong <Jonathan Dong> on 2012-03-22
Reviewed by Rob Buis.

Source/WebCore:

Modified the interface function authenticationChallenge() in class
PageClientBlackBerry, moved Credential from return value to the
function's reference parameter, and returned a bool to indicate if
user pressed Ok button or not.
Removed the logic which checks m_currentWebChallenge not null,
because we should challenge user again if the last provided credential
is not valid; also added the logic that will popup challenge
dialog again immediately if user press Ok buttton directly without
inputting anything.

No new tests.

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

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

Source/WebKit/blackberry:

Modified the interface function authenticationChallenge() in
class WebPagePrivate by returning a bool to indicate if user
pressed Ok button or not, and moved the Credential from return
value to the reference parameter.
Also updated the corresponding interface functions in class
WebPageClient.

  • Api/WebPage.cpp:

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

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

(WebPagePrivate):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r111809 r111810  
     12012-03-22  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
     2
     3        [BlackBerry] http authenticate dialog popup only once no matter authentication pass or fail
     4        https://bugs.webkit.org/show_bug.cgi?id=80135
     5
     6        Reviewed by Rob Buis.
     7
     8        Modified the interface function authenticationChallenge() in class
     9        PageClientBlackBerry, moved Credential from return value to the
     10        function's reference parameter, and returned a bool to indicate if
     11        user pressed Ok button or not.
     12        Removed the logic which checks m_currentWebChallenge not null,
     13        because we should challenge user again if the last provided credential
     14        is not valid; also added the logic that will popup challenge
     15        dialog again immediately if user press Ok buttton directly without
     16        inputting anything.
     17
     18        No new tests.
     19
     20        * platform/blackberry/PageClientBlackBerry.h:
     21        * platform/network/blackberry/NetworkJob.cpp:
     22        (WebCore::NetworkJob::handleAuthHeader):
     23        (WebCore::NetworkJob::sendRequestWithCredentials):
     24
    1252012-03-22  Jason Liu  <jason.liu@torchmobile.com.cn>
    226
  • trunk/Source/WebCore/platform/blackberry/PageClientBlackBerry.h

    r111546 r111810  
    7070    virtual int showAlertDialog(BlackBerry::WebKit::WebPageClient::AlertType) = 0;
    7171    virtual bool isActive() const = 0;
    72     virtual WebCore::Credential authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&) = 0;
     72    virtual bool authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, WebCore::Credential&) = 0;
    7373    virtual SaveCredentialType notifyShouldSaveCredential(bool) = 0;
    7474};
  • trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp

    r111809 r111810  
    750750        return false;
    751751
    752     if (!m_handle->getInternal()->m_currentWebChallenge.isNull())
    753         return false;
    754 
    755752    if (header.isEmpty())
    756753        return false;
     
    874871            m_handle->getInternal()->m_pass = "";
    875872        } else {
    876             Credential inputCredential = m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace);
    877             username = inputCredential.user();
    878             password = inputCredential.password();
    879         }
    880 
    881         if (username.isEmpty() && password.isEmpty())
    882             return false;
     873            Credential inputCredential;
     874            bool isConfirmed = false;
     875            do {
     876                isConfirmed = m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace, inputCredential);
     877                username = inputCredential.user();
     878                password = inputCredential.password();
     879            } while (isConfirmed && username.isEmpty() && password.isEmpty());
     880        }
    883881
    884882        credential = Credential(username, password, CredentialPersistenceForSession);
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r111774 r111810  
    20202020}
    20212021
    2022 Credential WebPagePrivate::authenticationChallenge(const KURL& url, const ProtectionSpace& protectionSpace)
     2022bool WebPagePrivate::authenticationChallenge(const KURL& url, const ProtectionSpace& protectionSpace, Credential& inputCredential)
    20232023{
    20242024    WebString username;
     
    20302030#endif
    20312031
    2032     m_client->authenticationChallenge(protectionSpace.realm().characters(), protectionSpace.realm().length(), username, password);
     2032    bool isConfirmed = m_client->authenticationChallenge(protectionSpace.realm().characters(), protectionSpace.realm().length(), username, password);
    20332033
    20342034#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
    2035     Credential inputCredential(username, password, CredentialPersistencePermanent);
     2035    Credential credential(username, password, CredentialPersistencePermanent);
    20362036    if (!m_webSettings->isPrivateBrowsingEnabled())
    20372037        credentialManager().saveCredentialIfConfirmed(this, CredentialTransformData(url, protectionSpace, inputCredential));
    20382038#else
    2039     Credential inputCredential(username, password, CredentialPersistenceNone);
    2040 #endif
    2041     return inputCredential;
     2039    Credential credential(username, password, CredentialPersistenceNone);
     2040#endif
     2041    inputCredential = credential;
     2042    return isConfirmed;
    20422043}
    20432044
  • trunk/Source/WebKit/blackberry/Api/WebPageClient.h

    r111546 r111810  
    212212
    213213    virtual void setPreventsScreenIdleDimming(bool noDimming) = 0;
    214     virtual void authenticationChallenge(const unsigned short* realm, unsigned int realmLength, WebString& username, WebString& password) = 0;
     214    virtual bool 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

    r111546 r111810  
    177177    virtual int showAlertDialog(WebPageClient::AlertType atype);
    178178    virtual bool isActive() const;
    179     virtual WebCore::Credential authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&);
     179    virtual bool authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, WebCore::Credential&);
    180180    virtual SaveCredentialType notifyShouldSaveCredential(bool);
    181181
  • trunk/Source/WebKit/blackberry/ChangeLog

    r111774 r111810  
     12012-03-22  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
     2
     3        [BlackBerry] http authenticate dialog popup only once no matter authentication pass or fail
     4        https://bugs.webkit.org/show_bug.cgi?id=80135
     5
     6        Reviewed by Rob Buis.
     7
     8        Modified the interface function authenticationChallenge() in
     9        class WebPagePrivate by returning a bool to indicate if user
     10        pressed Ok button or not, and moved the Credential from return
     11        value to the reference parameter.
     12        Also updated the corresponding interface functions in class
     13        WebPageClient.
     14
     15        * Api/WebPage.cpp:
     16        (BlackBerry::WebKit::WebPagePrivate::authenticationChallenge):
     17        * Api/WebPageClient.h:
     18        * Api/WebPage_p.h:
     19        (WebPagePrivate):
     20
    1212012-03-22  Mike Lattanzio  <mlattanzio@rim.com>
    222
Note: See TracChangeset for help on using the changeset viewer.