Title: [129404] trunk/Source/WebCore
Revision
129404
Author
[email protected]
Date
2012-09-24 13:21:35 -0700 (Mon, 24 Sep 2012)

Log Message

[BlackBerry] Reverting implementation for 407 error pages
https://bugs.webkit.org/show_bug.cgi?id=97455

Patch by Otto Derek Cheung <[email protected]> on 2012-09-24
Reviewed by Rob Buis.

Revert "[BlackBerry] Show custom error page when 407 is received"
This reverts commit e6d14529428fe47916fcb997528095b8acad2f2b.

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::handleNotifyStatusReceived):
(WebCore::NetworkJob::notifyAuthReceived):
(WebCore::NetworkJob::sendRequestWithCredentials):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (129403 => 129404)


--- trunk/Source/WebCore/ChangeLog	2012-09-24 20:09:58 UTC (rev 129403)
+++ trunk/Source/WebCore/ChangeLog	2012-09-24 20:21:35 UTC (rev 129404)
@@ -1,3 +1,18 @@
+2012-09-24  Otto Derek Cheung  <[email protected]>
+
+        [BlackBerry] Reverting implementation for 407 error pages
+        https://bugs.webkit.org/show_bug.cgi?id=97455
+
+        Reviewed by Rob Buis.
+
+        Revert "[BlackBerry] Show custom error page when 407 is received"
+        This reverts commit e6d14529428fe47916fcb997528095b8acad2f2b.
+
+        * platform/network/blackberry/NetworkJob.cpp:
+        (WebCore::NetworkJob::handleNotifyStatusReceived):
+        (WebCore::NetworkJob::notifyAuthReceived):
+        (WebCore::NetworkJob::sendRequestWithCredentials):
+
 2012-09-24  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r129388.

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


--- trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp	2012-09-24 20:09:58 UTC (rev 129403)
+++ trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp	2012-09-24 20:21:35 UTC (rev 129404)
@@ -192,12 +192,6 @@
     if (isInfo(status))
         return; // ignore
 
-    // Load up error page and ask the user to change their wireless proxy settings
-    if (status == 407) {
-        const ResourceError error = ResourceError(ResourceError::httpErrorDomain, BlackBerry::Platform::FilterStream::StatusWifiProxyAuthError, m_response.url().string(), emptyString());
-        m_handle->client()->didFail(m_handle.get(), error);
-    }
-
     m_statusReceived = true;
 
     // Convert non-HTTP status codes to generic HTTP codes.
@@ -300,10 +294,11 @@
         }
         storeCredentials();
         return;
-    } else {
-        purgeCredentials();
-        m_newJobWithCredentialsStarted = sendRequestWithCredentials(serverType, scheme, realm, requireCredentials);
     }
+
+    purgeCredentials();
+    m_newJobWithCredentialsStarted = sendRequestWithCredentials(serverType, scheme, realm, requireCredentials);
+
 }
 
 void NetworkJob::notifyStringHeaderReceived(const String& key, const String& value)
@@ -733,8 +728,15 @@
 
     String host;
     int port;
-    host = m_response.url().host();
-    port = m_response.url().port();
+    if (type == ProtectionSpaceProxyHTTP) {
+        String proxyAddress = BlackBerry::Platform::Client::get()->getProxyAddress(newURL.string().ascii().data()).c_str();
+        KURL proxyURL(KURL(), proxyAddress);
+        host = proxyURL.host();
+        port = proxyURL.port();
+    } else {
+        host = m_response.url().host();
+        port = m_response.url().port();
+    }
 
     ProtectionSpace protectionSpace(host, port, type, realm, scheme);
 
@@ -761,30 +763,37 @@
         String username;
         String password;
 
-        // 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;
-            password = m_handle->getInternal()->m_pass;
+        if (type == ProtectionSpaceProxyHTTP) {
+            username = BlackBerry::Platform::Client::get()->getProxyUsername().c_str();
+            password = BlackBerry::Platform::Client::get()->getProxyPassword().c_str();
+        }
 
-            // Prevent them from been used again if they are wrong.
-            // If they are correct, they will the put into CredentialStorage.
-            m_handle->getInternal()->m_user = "";
-            m_handle->getInternal()->m_pass = "";
-        } else {
-            if (m_handle->firstRequest().targetType() != ResourceRequest::TargetIsMainFrame && BlackBerry::Platform::Settings::instance()->isChromeProcess())
-                return false;
+        if (username.isEmpty() || password.isEmpty()) {
+            // 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;
+                password = m_handle->getInternal()->m_pass;
 
-            m_handle->getInternal()->m_currentWebChallenge = AuthenticationChallenge();
+                // Prevent them from been used again if they are wrong.
+                // If they are correct, they will the put into CredentialStorage.
+                m_handle->getInternal()->m_user = "";
+                m_handle->getInternal()->m_pass = "";
+            } else {
+                if (m_handle->firstRequest().targetType() != ResourceRequest::TargetIsMainFrame && BlackBerry::Platform::Settings::instance()->isChromeProcess())
+                    return false;
 
-            m_isAuthenticationChallenging = true;
-            updateDeferLoadingCount(1);
+                m_handle->getInternal()->m_currentWebChallenge = AuthenticationChallenge();
 
-            AuthenticationChallengeManager::instance()->authenticationChallenge(newURL,
-                                                                                protectionSpace,
-                                                                                Credential(),
-                                                                                this,
-                                                                                m_frame->page()->chrome()->client()->platformPageClient());
-            return true;
+                m_isAuthenticationChallenging = true;
+                updateDeferLoadingCount(1);
+
+                AuthenticationChallengeManager::instance()->authenticationChallenge(newURL,
+                                                                                    protectionSpace,
+                                                                                    Credential(),
+                                                                                    this,
+                                                                                    m_frame->page()->chrome()->client()->platformPageClient());
+                return true;
+            }
         }
 
         credential = Credential(username, password, CredentialPersistenceForSession);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to