Changeset 193654 in webkit


Ignore:
Timestamp:
Dec 7, 2015 2:44:33 PM (8 years ago)
Author:
Chris Dumez
Message:

[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:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r193645 r193654  
     12015-12-07  Chris Dumez  <cdumez@apple.com>
     2
     3        [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
     4        https://bugs.webkit.org/show_bug.cgi?id=151960
     5        <rdar://problem/23618112>
     6
     7        Reviewed by Alex Christensen.
     8
     9        After r187691, if a page is showing an auth pane in one tab, any new
     10        tabs with same page hang until credentials are entered in first tab.
     11        This is because we coalescing all authentication challenges from the
     12        same domain, no matter what tab they are for. This can be confusing
     13        so we now only coalesce authentication challenges within each tab,
     14        by leveraging the pageID (in addition to the domain).
     15
     16        * Shared/Authentication/AuthenticationManager.cpp:
     17        (WebKit::AuthenticationManager::shouldCoalesceChallenge):
     18        (WebKit::AuthenticationManager::coalesceChallengesMatching):
     19        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
     20        * Shared/Authentication/AuthenticationManager.h:
     21
    1222015-12-07  Beth Dakin  <bdakin@apple.com>
    223
  • trunk/Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp

    r192697 r193654  
    7777}
    7878
    79 bool AuthenticationManager::shouldCoalesceChallenge(uint64_t challengeID, const AuthenticationChallenge& challenge) const
     79bool AuthenticationManager::shouldCoalesceChallenge(uint64_t pageID, uint64_t challengeID, const AuthenticationChallenge& challenge) const
    8080{
    8181    if (!canCoalesceChallenge(challenge))
     
    8383
    8484    for (auto& item : m_challenges) {
    85         if (item.key != challengeID && ProtectionSpace::compare(challenge.protectionSpace(), item.value.challenge.protectionSpace()))
     85        if (item.key != challengeID && item.value.pageID == pageID && ProtectionSpace::compare(challenge.protectionSpace(), item.value.challenge.protectionSpace()))
    8686            return true;
    8787    }
     
    101101
    102102    for (auto& item : m_challenges) {
    103         if (item.key != challengeID && ProtectionSpace::compare(challenge.challenge.protectionSpace(), item.value.challenge.protectionSpace()))
     103        if (item.key != challengeID && item.value.pageID == challenge.pageID && ProtectionSpace::compare(challenge.challenge.protectionSpace(), item.value.challenge.protectionSpace()))
    104104            challengesToCoalesce.append(item.key);
    105105    }
     
    113113    ASSERT(frame->page());
    114114
    115     uint64_t challengeID = addChallengeToChallengeMap({authenticationChallenge
     115    auto pageID = frame->page()->pageID();
     116    uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge
    116117#if USE(NETWORK_SESSION)
    117118        , ChallengeCompletionHandler()
     
    119120    });
    120121
    121     // Coalesce challenges in the same protection space.
    122     if (shouldCoalesceChallenge(challengeID, authenticationChallenge))
     122    // Coalesce challenges in the same protection space and in the same page.
     123    if (shouldCoalesceChallenge(pageID, challengeID, authenticationChallenge))
    123124        return;
    124125   
     
    132133    ASSERT(frameID);
    133134
    134     uint64_t challengeID = addChallengeToChallengeMap({authenticationChallenge, completionHandler});
    135     if (shouldCoalesceChallenge(challengeID, authenticationChallenge))
     135    uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge, completionHandler});
     136
     137    // Coalesce challenges in the same protection space and in the same page.
     138    if (shouldCoalesceChallenge(pageID, challengeID, authenticationChallenge))
    136139        return;
    137140   
     
    144147    ASSERT(frameID);
    145148
    146     uint64_t challengeID = addChallengeToChallengeMap({authenticationChallenge
     149    uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge
    147150#if USE(NETWORK_SESSION)
    148151        , ChallengeCompletionHandler()
    149152#endif
    150153    });
    151     if (shouldCoalesceChallenge(challengeID, authenticationChallenge))
     154
     155    // Coalesce challenges in the same protection space and in the same page.
     156    if (shouldCoalesceChallenge(pageID, challengeID, authenticationChallenge))
    152157        return;
    153158   
     
    158163void AuthenticationManager::didReceiveAuthenticationChallenge(Download* download, const AuthenticationChallenge& authenticationChallenge)
    159164{
    160     uint64_t challengeID = addChallengeToChallengeMap({authenticationChallenge});
    161     if (shouldCoalesceChallenge(challengeID, authenticationChallenge))
     165    uint64_t dummyPageID = 0;
     166    uint64_t challengeID = addChallengeToChallengeMap({dummyPageID, authenticationChallenge});
     167
     168    // Coalesce challenges in the same protection space and in the same page.
     169    if (shouldCoalesceChallenge(dummyPageID, challengeID, authenticationChallenge))
    162170        return;
    163171
  • trunk/Source/WebKit2/Shared/Authentication/AuthenticationManager.h

    r192982 r193654  
    7575private:
    7676    struct Challenge {
     77        uint64_t pageID;
    7778        WebCore::AuthenticationChallenge challenge;
    7879#if USE(NETWORK_SESSION)
     
    8788
    8889    uint64_t addChallengeToChallengeMap(const Challenge&);
    89     bool shouldCoalesceChallenge(uint64_t challengeID, const WebCore::AuthenticationChallenge&) const;
     90    bool shouldCoalesceChallenge(uint64_t pageID, uint64_t challengeID, const WebCore::AuthenticationChallenge&) const;
    9091
    9192    void useCredentialForSingleChallenge(uint64_t challengeID, const WebCore::Credential&, const WebCore::CertificateInfo&);
Note: See TracChangeset for help on using the changeset viewer.