Bug 147496

Summary: Coalesce concurrent authentication challenges for the same ProtectionSpace
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, barraclough, beidson, darin, ddkilzer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2015-07-31 11:42:37 PDT
Coalesce concurrent authentication challenges for the same ProtectionSpace. Ideally, this would be done in the network layer but short term, this will make sure the user no longer gets repeating authentication dialogs for the same protection space.
Comment 1 Chris Dumez 2015-07-31 11:42:54 PDT
rdar://problem/21863706
Comment 2 Chris Dumez 2015-07-31 13:20:00 PDT
Created attachment 257952 [details]
Patch
Comment 3 Chris Dumez 2015-07-31 15:02:53 PDT

*** This bug has been marked as a duplicate of bug 128006 ***
Comment 4 Darin Adler 2015-08-08 14:06:19 PDT
Comment on attachment 257952 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=257952&action=review

> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:82
> +    auto end =  m_challenges.end();
> +    for (auto it = m_challenges.begin(); it != end; ++it) {
> +        if (it->key != challengeID && ProtectionSpace::compare(authenticationChallenge.protectionSpace(), it->value.protectionSpace()))
> +            return true;
> +    }

Why does this use an explicit iterator instead of a modern for loop?

> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:97
> +    auto end = m_challenges.end();
> +    for (auto it = m_challenges.begin(); it != end; ++it) {
> +        if (it->key == challengeID || ProtectionSpace::compare(challenge.protectionSpace(), it->value.protectionSpace()))
> +            challengesToCoalesce.append(it->key);
> +    }

Same question here.
Comment 5 Chris Dumez 2015-08-08 19:24:11 PDT
Comment on attachment 257952 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=257952&action=review

>> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:82
>> +    }
> 
> Why does this use an explicit iterator instead of a modern for loop?

Just an oversight, I'll fix this.

>> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:97
>> +    }
> 
> Same question here.

and this.
Comment 6 Chris Dumez 2015-08-08 20:21:00 PDT
(In reply to comment #5)
> Comment on attachment 257952 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=257952&action=review
> 
> >> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:82
> >> +    }
> > 
> > Why does this use an explicit iterator instead of a modern for loop?
> 
> Just an oversight, I'll fix this.
> 
> >> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:97
> >> +    }
> > 
> > Same question here.
> 
> and this.

Updated patch to https://bugs.webkit.org/show_bug.cgi?id=128006 as this bug is a duplicate.