[WK2] Authentication dialog is displayed for cross-origin XHR
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Sep 2014 17:20:18 +0000 (17:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Sep 2014 17:20:18 +0000 (17:20 +0000)
commit0c5a5db1f5b8cf82ce4524b36367b69d0823daa9
tree0605fdd2f8ab13d99eb52db484b692a072cef2bc
parent7dda3e993c0d4fa480594687f9c9b880361d67ab
[WK2] Authentication dialog is displayed for cross-origin XHR
https://bugs.webkit.org/show_bug.cgi?id=131349

Patch by Youenn Fablet <youenn.fablet@crf.canon.fr> on 2014-09-11
Reviewed by Alexey Proskuryakov.

Source/WebCore:

* WebCore.exp.in: Export of isAllowedToAskUserForCredentials.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::isAllowedToAskUserForCredentials): Replacing clientCredentialPolicy method. Returns true if credentials can be requested to the user.
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge): Updated to use isAllowedToAskUserForCredentials.
* loader/ResourceLoader.h: Removing clientCredentialPolicy method and adding isAllowedToAskUserForCredentials method.

Source/WebKit2:

Precomputing client credential policy in the Web Process before sending the resource load task to the Network Process.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveAuthenticationChallenge): Added an ASSERT to ensure that credential policy is never set to DoNotAskClientForCrossOriginCredentials.
* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad): Precomputing client credential policy to handle the case of cross-origin requests.
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest): Added a TODO to check whether redirections need a specific handling.

LayoutTests:

* platform/mac-wk2/TestExpectations: Unskipped tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp