Title: [115104] trunk
Revision
115104
Author
[email protected]
Date
2012-04-24 13:52:51 -0700 (Tue, 24 Apr 2012)

Log Message

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

Patch by Joe Mason <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (115103 => 115104)


--- trunk/Source/WebCore/ChangeLog	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Source/WebCore/ChangeLog	2012-04-24 20:52:51 UTC (rev 115104)
@@ -1,3 +1,18 @@
+2012-04-24  Joe Mason  <[email protected]>
+
+        [BlackBerry] Revert broken changes to authentication dialog
+        https://bugs.webkit.org/show_bug.cgi?id=80135
+
+        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.
+
+        * platform/blackberry/PageClientBlackBerry.h:
+        * platform/network/blackberry/NetworkJob.cpp:
+        (WebCore::NetworkJob::handleAuthHeader):
+        (WebCore::NetworkJob::sendRequestWithCredentials):
+
 2012-04-24  Caio Marcelo de Oliveira Filho  <[email protected]>
 
         Fix wrong ASSERT() in findAttributeInVector()

Modified: trunk/Source/WebCore/platform/blackberry/PageClientBlackBerry.h (115103 => 115104)


--- trunk/Source/WebCore/platform/blackberry/PageClientBlackBerry.h	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Source/WebCore/platform/blackberry/PageClientBlackBerry.h	2012-04-24 20:52:51 UTC (rev 115104)
@@ -70,7 +70,7 @@
     virtual int showAlertDialog(BlackBerry::WebKit::WebPageClient::AlertType) = 0;
     virtual bool isActive() const = 0;
     virtual bool isVisible() const = 0;
-    virtual bool authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, WebCore::Credential&) = 0;
+    virtual WebCore::Credential authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&) = 0;
     virtual SaveCredentialType notifyShouldSaveCredential(bool) = 0;
 };
 

Modified: trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp (115103 => 115104)


--- trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp	2012-04-24 20:52:51 UTC (rev 115104)
@@ -741,6 +741,9 @@
     if (!m_handle)
         return false;
 
+    if (!m_handle->getInternal()->m_currentWebChallenge.isNull())
+        return false;
+
     if (header.isEmpty())
         return false;
 
@@ -849,6 +852,9 @@
         String username;
         String password;
 
+        if (!m_frame || !m_frame->loader() || !m_frame->loader()->client())
+            return false;
+
         // Before asking the user for credentials, we check if the URL contains that.
         if (!m_handle->getInternal()->m_user.isEmpty() && !m_handle->getInternal()->m_pass.isEmpty()) {
             username = m_handle->getInternal()->m_user.utf8().data();
@@ -859,15 +865,14 @@
             m_handle->getInternal()->m_user = "";
             m_handle->getInternal()->m_pass = "";
         } else {
-            Credential inputCredential;
-            bool isConfirmed = m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace, inputCredential);
+            Credential inputCredential = m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace);
             username = inputCredential.user();
             password = inputCredential.password();
-
-            if (!isConfirmed)
-                return false;
         }
 
+        if (username.isEmpty() && password.isEmpty())
+            return false;
+
         credential = Credential(username, password, CredentialPersistenceForSession);
 
         m_handle->getInternal()->m_currentWebChallenge = AuthenticationChallenge(protectionSpace, credential, 0, m_response, ResourceError());

Modified: trunk/Source/WebKit/blackberry/Api/DumpRenderTreeClient.h (115103 => 115104)


--- trunk/Source/WebKit/blackberry/Api/DumpRenderTreeClient.h	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Source/WebKit/blackberry/Api/DumpRenderTreeClient.h	2012-04-24 20:52:51 UTC (rev 115104)
@@ -25,7 +25,6 @@
 #include <_javascript_Core/JSObjectRef.h>
 
 namespace WebCore {
-class Credential;
 class Frame;
 class DOMWrapperWorld;
 class NavigationAction;
@@ -82,7 +81,6 @@
     virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, int insertAction) = 0;
     virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, int insertAction) = 0;
     virtual bool isSelectTrailingWhitespaceEnabled() const = 0;
-    virtual bool didReceiveAuthenticationChallenge(WebCore::Credential&) = 0;
 
 };
 }

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (115103 => 115104)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-04-24 20:52:51 UTC (rev 115104)
@@ -2039,32 +2039,26 @@
     return m_client->isActive();
 }
 
-bool WebPagePrivate::authenticationChallenge(const KURL& url, const ProtectionSpace& protectionSpace, Credential& inputCredential)
+Credential WebPagePrivate::authenticationChallenge(const KURL& url, const ProtectionSpace& protectionSpace)
 {
     WebString username;
     WebString password;
 
-#if ENABLE_DRT
-    if (m_dumpRenderTree)
-        return m_dumpRenderTree->didReceiveAuthenticationChallenge(inputCredential);
-#endif
-
 #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
     if (!m_webSettings->isPrivateBrowsingEnabled())
         credentialManager().autofillAuthenticationChallenge(protectionSpace, username, password);
 #endif
 
-    bool isConfirmed = m_client->authenticationChallenge(protectionSpace.realm().characters(), protectionSpace.realm().length(), username, password);
+    m_client->authenticationChallenge(protectionSpace.realm().characters(), protectionSpace.realm().length(), username, password);
 
 #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
-    Credential credential(username, password, CredentialPersistencePermanent);
+    Credential inputCredential(username, password, CredentialPersistencePermanent);
     if (!m_webSettings->isPrivateBrowsingEnabled())
-        credentialManager().saveCredentialIfConfirmed(this, CredentialTransformData(url, protectionSpace, credential));
+        credentialManager().saveCredentialIfConfirmed(this, CredentialTransformData(url, protectionSpace, inputCredential));
 #else
-    Credential credential(username, password, CredentialPersistenceNone);
+    Credential inputCredential(username, password, CredentialPersistenceNone);
 #endif
-    inputCredential = credential;
-    return isConfirmed;
+    return inputCredential;
 }
 
 PageClientBlackBerry::SaveCredentialType WebPagePrivate::notifyShouldSaveCredential(bool isNew)

Modified: trunk/Source/WebKit/blackberry/Api/WebPageClient.h (115103 => 115104)


--- trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2012-04-24 20:52:51 UTC (rev 115104)
@@ -211,7 +211,7 @@
     virtual void animateBlockZoom(const Platform::FloatPoint& finalPoint, double finalScale) = 0;
 
     virtual void setPreventsScreenIdleDimming(bool noDimming) = 0;
-    virtual bool authenticationChallenge(const unsigned short* realm, unsigned int realmLength, WebString& username, WebString& password) = 0;
+    virtual void authenticationChallenge(const unsigned short* realm, unsigned int realmLength, WebString& username, WebString& password) = 0;
     virtual SaveCredentialType notifyShouldSaveCredential(bool isNew) = 0;
 
     virtual bool shouldPluginEnterFullScreen() = 0;

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (115103 => 115104)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-04-24 20:52:51 UTC (rev 115104)
@@ -179,7 +179,7 @@
     virtual int showAlertDialog(WebPageClient::AlertType atype);
     virtual bool isActive() const;
     virtual bool isVisible() const { return m_visible; }
-    virtual bool authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, WebCore::Credential&);
+    virtual WebCore::Credential authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&);
     virtual SaveCredentialType notifyShouldSaveCredential(bool);
 
     // Called from within WebKit via ChromeClientBlackBerry.

Modified: trunk/Source/WebKit/blackberry/ChangeLog (115103 => 115104)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-04-24 20:52:51 UTC (rev 115104)
@@ -1,3 +1,20 @@
+2012-04-24  Joe Mason  <[email protected]>
+
+        [BlackBerry] Revert broken changes to authentication dialog
+        https://bugs.webkit.org/show_bug.cgi?id=80135
+
+        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.
+
+        * Api/DumpRenderTreeClient.h:
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::authenticationChallenge):
+        * Api/WebPageClient.h:
+        * Api/WebPage_p.h:
+        (WebPagePrivate):
+
 2012-04-24  Mike Fenton  <[email protected]>
 
         [BlackBerry] Add additional details including the bounds of the box for caretPositionChanged.

Modified: trunk/Tools/ChangeLog (115103 => 115104)


--- trunk/Tools/ChangeLog	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Tools/ChangeLog	2012-04-24 20:52:51 UTC (rev 115104)
@@ -1,3 +1,17 @@
+2012-04-24  Joe Mason  <[email protected]>
+
+        [BlackBerry] Revert broken changes to authentication dialog
+        https://bugs.webkit.org/show_bug.cgi?id=80135
+
+        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.
+
+        * DumpRenderTree/blackberry/DumpRenderTree.cpp:
+        * DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:
+        (WebCore):
+
 2012-04-24  Zan Dobersek  <[email protected]>
 
         [TestResultsServer] Add a unit test for changes in r114868

Modified: trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp (115103 => 115104)


--- trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp	2012-04-24 20:52:51 UTC (rev 115104)
@@ -23,7 +23,6 @@
 #include "BackForwardController.h"
 #include "BackForwardListImpl.h"
 #include "CString.h"
-#include "Credential.h"
 #include "DatabaseTracker.h"
 #include "DocumentLoader.h"
 #include "DumpRenderTree/GCController.h"
@@ -122,11 +121,6 @@
     return "frame (anonymous)";
 }
 
-static WTF::String drtCredentialDescription(WebCore::Credential&)
-{
-    return "<unknown>";
-}
-
 static bool shouldLogFrameLoadDelegates(const WTF::String& url)
 {
     return url.contains("loading/");
@@ -813,22 +807,8 @@
         printf("%s has MIME type %s\n", response.url().lastPathComponent().utf8().data(), response.mimeType().utf8().data());
 }
 
-bool DumpRenderTree::didReceiveAuthenticationChallenge(WebCore::Credential& credential)
-{
-    if (!gLayoutTestController->handlesAuthenticationChallenges()) {
-        credential = WebCore::Credential();
-        printf("%s - didReceiveAuthenticationChallenge - Simulating cancelled authentication\n", drtCredentialDescription(credential).utf8().data());
-        return false;
-    }
-    const char* user = gLayoutTestController->authenticationUsername().c_str();
-    const char* password = gLayoutTestController->authenticationPassword().c_str();
-    credential = WebCore::Credential(user, password, WebCore::CredentialPersistenceForSession);
-    printf("%s - didReceiveAuthenticationChallenge - Responding with %s:%s\n", drtCredentialDescription(credential).utf8().data(), user, password);
-    return true;
 }
-
 }
-}
 
 // Static dump() function required by cross-platform DRT code.
 void dump()

Modified: trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h (115103 => 115104)


--- trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h	2012-04-24 20:43:01 UTC (rev 115103)
+++ trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h	2012-04-24 20:52:51 UTC (rev 115104)
@@ -28,9 +28,8 @@
 #include <wtf/Vector.h>
 
 namespace WebCore {
-class Credential;
-class DOMWrapperWorld;
 class Frame;
+class DOMWrapperWorld;
 class Range;
 }
 
@@ -102,7 +101,6 @@
 
     bool isSelectTrailingWhitespaceEnabled() const { return s_selectTrailingWhitespaceEnabled; }
     void setSelectTrailingWhitespaceEnabled(bool enabled) { s_selectTrailingWhitespaceEnabled = enabled; }
-    bool didReceiveAuthenticationChallenge(WebCore::Credential&);
 
 private:
     void runTest(const WTF::String& url);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to