HTML5 video tag Does Not Load in Apache htaccess/htpasswd Protected Directory
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jan 2014 22:24:37 +0000 (22:24 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jan 2014 22:24:37 +0000 (22:24 +0000)
commitcb366d7c10661fad375cd2e25ffc3c3618f9495e
tree1f13f39f47be9059e90135dfa6da7da3cf65653c
parent42d4dff7f55ba8e035930134729bf469e3da08c9
HTML5 video tag Does Not Load in Apache htaccess/htpasswd Protected Directory
https://bugs.webkit.org/show_bug.cgi?id=40382

Reviewed by Eric Carlson.

Source/WebCore:

Test: http/tests/media/video-auth.html

Adopt a new AVFoundation API to handle authentication challenge generated while loading
media through an AVAsset. The authentication request comes through as a
NSURLAuthenticationChallenge, and is wrapped in a WebCore::AuthenticationChallenge
by MediaPlayerPrivateAVFoundationObjC, and is sent up to the HTMLMediaElement to handle.
The HTMLMediaElement creates a ResourceRequest, and passes the challenge up to the
ResourceLoadNotifier.

To allow the HTMLMediaElement to initiate handling an AuthenticationChallenge without
actually creating a ResourceLoader, allow ResourceLoaderDelegate to accept a unique
identifier and a DocumentLoader in lieu of a ResourceLoader.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLMediaElement.h:
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didReceiveAuthenticationChallenge):
(WebCore::ResourceLoadNotifier::didCancelAuthenticationChallenge):
* loader/ResourceLoadNotifier.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldWaitForResponseToAuthenticationChallenge):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForResponseToAuthenticationChallenge:]):

LayoutTests:

* http/tests/media/resources/video-auth.php: Added.
* http/tests/media/video-auth-expected.txt: Added.
* http/tests/media/video-auth.html: Added.
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/media/resources/video-auth.php [new file with mode: 0644]
LayoutTests/http/tests/media/video-auth-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/media/video-auth.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/loader/ResourceLoadNotifier.cpp
Source/WebCore/loader/ResourceLoadNotifier.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm