Title: [195108] releases/WebKitGTK/webkit-2.10/Source/WebKit2
Revision
195108
Author
[email protected]
Date
2016-01-15 02:30:42 -0800 (Fri, 15 Jan 2016)

Log Message

Merge r193654 - [WK2] Regression(r187691): If a page is showing an auth pane in one tab, any new tabs with same page hang until credentials are entered in first tab
https://bugs.webkit.org/show_bug.cgi?id=151960
<rdar://problem/23618112>

Reviewed by Alex Christensen.

After r187691, if a page is showing an auth pane in one tab, any new
tabs with same page hang until credentials are entered in first tab.
This is because we coalescing all authentication challenges from the
same domain, no matter what tab they are for. This can be confusing
so we now only coalesce authentication challenges within each tab,
by leveraging the pageID (in addition to the domain).

* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::shouldCoalesceChallenge):
(WebKit::AuthenticationManager::coalesceChallengesMatching):
(WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
* Shared/Authentication/AuthenticationManager.h:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog (195107 => 195108)


--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog	2016-01-15 10:30:27 UTC (rev 195107)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog	2016-01-15 10:30:42 UTC (rev 195108)
@@ -1,3 +1,24 @@
+2015-12-07  Chris Dumez  <[email protected]>
+
+        [WK2] Regression(r187691): If a page is showing an auth pane in one tab, any new tabs with same page hang until credentials are entered in first tab
+        https://bugs.webkit.org/show_bug.cgi?id=151960
+        <rdar://problem/23618112>
+
+        Reviewed by Alex Christensen.
+
+        After r187691, if a page is showing an auth pane in one tab, any new
+        tabs with same page hang until credentials are entered in first tab.
+        This is because we coalescing all authentication challenges from the
+        same domain, no matter what tab they are for. This can be confusing
+        so we now only coalesce authentication challenges within each tab,
+        by leveraging the pageID (in addition to the domain).
+
+        * Shared/Authentication/AuthenticationManager.cpp:
+        (WebKit::AuthenticationManager::shouldCoalesceChallenge):
+        (WebKit::AuthenticationManager::coalesceChallengesMatching):
+        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
+        * Shared/Authentication/AuthenticationManager.h:
+
 2015-11-10  Alex Christensen  <[email protected]>
 
         Implement authentication challenge handling when using NETWORK_SESSION

Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp (195107 => 195108)


--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp	2016-01-15 10:30:27 UTC (rev 195107)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp	2016-01-15 10:30:42 UTC (rev 195108)
@@ -79,13 +79,13 @@
     return challengeID;
 }
 
-bool AuthenticationManager::shouldCoalesceChallenge(uint64_t challengeID, const AuthenticationChallenge& challenge) const
+bool AuthenticationManager::shouldCoalesceChallenge(uint64_t pageID, uint64_t challengeID, const AuthenticationChallenge& challenge) const
 {
     if (!canCoalesceChallenge(challenge))
         return false;
 
     for (auto& item : m_challenges) {
-        if (item.key != challengeID && ProtectionSpace::compare(challenge.protectionSpace(), item.value.challenge.protectionSpace()))
+        if (item.key != challengeID && item.value.pageID == pageID && ProtectionSpace::compare(challenge.protectionSpace(), item.value.challenge.protectionSpace()))
             return true;
     }
     return false;
@@ -103,7 +103,7 @@
         return challengesToCoalesce;
 
     for (auto& item : m_challenges) {
-        if (item.key != challengeID && ProtectionSpace::compare(challenge.challenge.protectionSpace(), item.value.challenge.protectionSpace()))
+        if (item.key != challengeID && item.value.pageID == challenge.pageID && ProtectionSpace::compare(challenge.challenge.protectionSpace(), item.value.challenge.protectionSpace()))
             challengesToCoalesce.append(item.key);
     }
 
@@ -115,14 +115,15 @@
     ASSERT(frame);
     ASSERT(frame->page());
 
-    uint64_t challengeID = addChallengeToChallengeMap({authenticationChallenge
+    auto pageID = frame->page()->pageID();
+    uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge
 #if USE(NETWORK_SESSION)
         , ChallengeCompletionHandler()
 #endif
     });
 
-    // Coalesce challenges in the same protection space.
-    if (shouldCoalesceChallenge(challengeID, authenticationChallenge))
+    // Coalesce challenges in the same protection space and in the same page.
+    if (shouldCoalesceChallenge(pageID, challengeID, authenticationChallenge))
         return;
     
     m_process->send(Messages::WebPageProxy::DidReceiveAuthenticationChallenge(frame->frameID(), authenticationChallenge, challengeID), frame->page()->pageID());
@@ -135,8 +136,10 @@
     ASSERT(pageID);
     ASSERT(frameID);
 
-    uint64_t challengeID = addChallengeToChallengeMap({authenticationChallenge, completionHandler});
-    if (shouldCoalesceChallenge(challengeID, authenticationChallenge))
+    uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge, completionHandler});
+
+    // Coalesce challenges in the same protection space and in the same page.
+    if (shouldCoalesceChallenge(pageID, challengeID, authenticationChallenge))
         return;
     
     m_process->send(Messages::NetworkProcessProxy::DidReceiveAuthenticationChallenge(pageID, frameID, authenticationChallenge, challengeID));
@@ -147,12 +150,14 @@
     ASSERT(pageID);
     ASSERT(frameID);
 
-    uint64_t challengeID = addChallengeToChallengeMap({authenticationChallenge
+    uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge
 #if USE(NETWORK_SESSION)
         , ChallengeCompletionHandler()
 #endif
     });
-    if (shouldCoalesceChallenge(challengeID, authenticationChallenge))
+
+    // Coalesce challenges in the same protection space and in the same page.
+    if (shouldCoalesceChallenge(pageID, challengeID, authenticationChallenge))
         return;
     
     m_process->send(Messages::NetworkProcessProxy::DidReceiveAuthenticationChallenge(pageID, frameID, authenticationChallenge, challengeID));
@@ -162,8 +167,11 @@
 #if !USE(NETWORK_SESSION)
 void AuthenticationManager::didReceiveAuthenticationChallenge(Download* download, const AuthenticationChallenge& authenticationChallenge)
 {
-    uint64_t challengeID = addChallengeToChallengeMap({authenticationChallenge});
-    if (shouldCoalesceChallenge(challengeID, authenticationChallenge))
+    uint64_t dummyPageID = 0;
+    uint64_t challengeID = addChallengeToChallengeMap({dummyPageID, authenticationChallenge});
+
+    // Coalesce challenges in the same protection space and in the same page.
+    if (shouldCoalesceChallenge(dummyPageID, challengeID, authenticationChallenge))
         return;
 
     download->send(Messages::DownloadProxy::DidReceiveAuthenticationChallenge(authenticationChallenge, challengeID));

Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/Shared/Authentication/AuthenticationManager.h (195107 => 195108)


--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/Shared/Authentication/AuthenticationManager.h	2016-01-15 10:30:27 UTC (rev 195107)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/Shared/Authentication/AuthenticationManager.h	2016-01-15 10:30:42 UTC (rev 195108)
@@ -73,6 +73,7 @@
 
 private:
     struct Challenge {
+        uint64_t pageID;
         WebCore::AuthenticationChallenge challenge;
 #if USE(NETWORK_SESSION)
         ChallengeCompletionHandler completionHandler;
@@ -85,7 +86,7 @@
     bool tryUseCertificateInfoForChallenge(const WebCore::AuthenticationChallenge&, const WebCore::CertificateInfo&);
 
     uint64_t addChallengeToChallengeMap(const Challenge&);
-    bool shouldCoalesceChallenge(uint64_t challengeID, const WebCore::AuthenticationChallenge&) const;
+    bool shouldCoalesceChallenge(uint64_t pageID, uint64_t challengeID, const WebCore::AuthenticationChallenge&) const;
 
     void useCredentialForSingleChallenge(uint64_t challengeID, const WebCore::Credential&, const WebCore::CertificateInfo&);
     void continueWithoutCredentialForSingleChallenge(uint64_t challengeID);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to