Title: [118716] trunk/Source/WebCore
Revision
118716
Author
commit-qu...@webkit.org
Date
2012-05-28 19:58:09 -0700 (Mon, 28 May 2012)

Log Message

[BlackBerry] http authentication challenge issue when loading favicon
https://bugs.webkit.org/show_bug.cgi?id=87665

Patch by Jonathan Dong <jonathan.d...@torchmobile.com.cn> on 2012-05-28
Reviewed by Rob Buis.

Provide the TargetType when generating a favicon loading
request. Loading favicons is triggered after the main resource
has been loaded and parsed, so if we cancel the authentication
challenge when loading main resource, we should also cancel
loading the favicon when it starts to load. If not we will
receive another challenge after we canceled the main resource
loading, which may confuse the user.

Internally reviewed by Joe Mason <jma...@rim.com>

No new tests because of no behavior changes.

* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::sendRequestWithCredentials):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118715 => 118716)


--- trunk/Source/WebCore/ChangeLog	2012-05-29 02:43:30 UTC (rev 118715)
+++ trunk/Source/WebCore/ChangeLog	2012-05-29 02:58:09 UTC (rev 118716)
@@ -1,3 +1,27 @@
+2012-05-28  Jonathan Dong  <jonathan.d...@torchmobile.com.cn>
+
+        [BlackBerry] http authentication challenge issue when loading favicon
+        https://bugs.webkit.org/show_bug.cgi?id=87665
+
+        Reviewed by Rob Buis.
+
+        Provide the TargetType when generating a favicon loading
+        request. Loading favicons is triggered after the main resource
+        has been loaded and parsed, so if we cancel the authentication
+        challenge when loading main resource, we should also cancel
+        loading the favicon when it starts to load. If not we will
+        receive another challenge after we canceled the main resource
+        loading, which may confuse the user.
+
+        Internally reviewed by Joe Mason <jma...@rim.com>
+
+        No new tests because of no behavior changes.
+
+        * loader/icon/IconLoader.cpp:
+        (WebCore::IconLoader::startLoading):
+        * platform/network/blackberry/NetworkJob.cpp:
+        (WebCore::NetworkJob::sendRequestWithCredentials):
+
 2012-05-28  MORITA Hajime  <morr...@google.com>
 
         Rename FrameLoaderClient::shadowDOMAllowed() to allowShadowDOM()

Modified: trunk/Source/WebCore/loader/icon/IconLoader.cpp (118715 => 118716)


--- trunk/Source/WebCore/loader/icon/IconLoader.cpp	2012-05-29 02:43:30 UTC (rev 118715)
+++ trunk/Source/WebCore/loader/icon/IconLoader.cpp	2012-05-29 02:58:09 UTC (rev 118716)
@@ -60,6 +60,9 @@
         return;
 
     ResourceRequest resourceRequest(m_frame->loader()->icon()->url());
+#if PLATFORM(BLACKBERRY)
+    resourceRequest.setTargetType(ResourceRequest::TargetIsFavicon);
+#endif
     resourceRequest.setPriority(ResourceLoadPriorityLow);
 
     m_resource = m_frame->document()->cachedResourceLoader()->requestRawResource(resourceRequest,

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


--- trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp	2012-05-29 02:43:30 UTC (rev 118715)
+++ trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp	2012-05-29 02:58:09 UTC (rev 118716)
@@ -760,6 +760,14 @@
         m_handle->getInternal()->m_currentWebChallenge = AuthenticationChallenge(protectionSpace, credential, 0, m_response, ResourceError());
         m_handle->getInternal()->m_currentWebChallenge.setStored(true);
     } else {
+        if (m_handle->firstRequest().targetType() == ResourceRequest::TargetIsFavicon) {
+            // The favicon loading is triggerred after the main resource has been loaded
+            // and parsed, so if we cancel the authentication challenge when loading the main
+            // resource, we should also cancel loading the favicon when it starts to
+            // load. If not we will receive another challenge which may confuse the user.
+            return false;
+        }
+
         // CredentialStore is empty. Ask the user via dialog.
         String username;
         String password;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to