Changeset 161455 in webkit
- Timestamp:
- Jan 7, 2014 2:24:37 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r161444 r161455 1 2014-01-06 Jer Noble <jer.noble@apple.com> 2 3 HTML5 video tag Does Not Load in Apache htaccess/htpasswd Protected Directory 4 https://bugs.webkit.org/show_bug.cgi?id=40382 5 6 Reviewed by Eric Carlson. 7 8 * http/tests/media/resources/video-auth.php: Added. 9 * http/tests/media/video-auth-expected.txt: Added. 10 * http/tests/media/video-auth.html: Added. 11 * platform/mac/TestExpectations: 12 1 13 2014-01-07 Brent Fulgham <bfulgham@apple.com> 2 14 -
trunk/LayoutTests/platform/mac/TestExpectations
r161444 r161455 1314 1314 webkit.org/b/126455 [ MountainLion ] webgl/1.0.2/conformance/rendering/gl-scissor-test.html [ Failure ] 1315 1315 webkit.org/b/126586 [ Mavericks Debug] webgl/1.0.2/conformance/rendering/gl-scissor-test.html [ Pass Failure ] 1316 1317 # HTTP Auth in Media is not supported in Mavericks and Mountain Lion 1318 webkit.org/b/40382 http/tests/media/video-auth.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r161452 r161455 1 2014-01-06 Jer Noble <jer.noble@apple.com> 2 3 HTML5 video tag Does Not Load in Apache htaccess/htpasswd Protected Directory 4 https://bugs.webkit.org/show_bug.cgi?id=40382 5 6 Reviewed by Eric Carlson. 7 8 Test: http/tests/media/video-auth.html 9 10 Adopt a new AVFoundation API to handle authentication challenge generated while loading 11 media through an AVAsset. The authentication request comes through as a 12 NSURLAuthenticationChallenge, and is wrapped in a WebCore::AuthenticationChallenge 13 by MediaPlayerPrivateAVFoundationObjC, and is sent up to the HTMLMediaElement to handle. 14 The HTMLMediaElement creates a ResourceRequest, and passes the challenge up to the 15 ResourceLoadNotifier. 16 17 To allow the HTMLMediaElement to initiate handling an AuthenticationChallenge without 18 actually creating a ResourceLoader, allow ResourceLoaderDelegate to accept a unique 19 identifier and a DocumentLoader in lieu of a ResourceLoader. 20 21 * html/HTMLMediaElement.cpp: 22 (WebCore::HTMLMediaElement::parseAttribute): 23 * html/HTMLMediaElement.h: 24 * loader/ResourceLoadNotifier.cpp: 25 (WebCore::ResourceLoadNotifier::didReceiveAuthenticationChallenge): 26 (WebCore::ResourceLoadNotifier::didCancelAuthenticationChallenge): 27 * loader/ResourceLoadNotifier.h: 28 * platform/graphics/MediaPlayer.cpp: 29 (WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge): 30 * platform/graphics/MediaPlayer.h: 31 (WebCore::MediaPlayerClient::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): 32 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: 33 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 34 (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge): 35 (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForResponseToAuthenticationChallenge:]): 36 1 37 2014-01-07 Commit Queue <commit-queue@webkit.org> 2 38 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r161280 r161455 63 63 #include "PageActivityAssertionToken.h" 64 64 #include "PageGroup.h" 65 #include "ProgressTracker.h" 65 66 #include "RenderVideo.h" 66 67 #include "RenderView.h" … … 5578 5579 } 5579 5580 5581 bool HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge& challenge) 5582 { 5583 Frame* frame = document().frame(); 5584 if (!frame) 5585 return false; 5586 5587 Page* page = frame->page(); 5588 if (!page) 5589 return false; 5590 5591 ResourceRequest request(m_currentSrc); 5592 ResourceLoadNotifier& notifier = frame->loader().notifier(); 5593 DocumentLoader* documentLoader = document().loader(); 5594 unsigned long identifier = page->progress().createUniqueIdentifier(); 5595 5596 notifier.assignIdentifierToInitialRequest(identifier, documentLoader, request); 5597 notifier.didReceiveAuthenticationChallenge(identifier, documentLoader, challenge); 5598 5599 return true; 5600 } 5601 5580 5602 void HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture() 5581 5603 { -
trunk/Source/WebCore/html/HTMLMediaElement.h
r161181 r161455 585 585 #endif 586 586 587 virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) OVERRIDE; 588 587 589 void loadTimerFired(Timer<HTMLMediaElement>*); 588 590 void progressEventTimerFired(Timer<HTMLMediaElement>*); -
trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp
r160841 r161455 54 54 void ResourceLoadNotifier::didReceiveAuthenticationChallenge(ResourceLoader* loader, const AuthenticationChallenge& currentWebChallenge) 55 55 { 56 m_frame.loader().client().dispatchDidReceiveAuthenticationChallenge(loader->documentLoader(), loader->identifier(), currentWebChallenge); 56 didReceiveAuthenticationChallenge(loader->identifier(), loader->documentLoader(), currentWebChallenge); 57 } 58 59 void ResourceLoadNotifier::didReceiveAuthenticationChallenge(unsigned long identifier, DocumentLoader* loader, const AuthenticationChallenge& currentWebChallenge) 60 { 61 m_frame.loader().client().dispatchDidReceiveAuthenticationChallenge(loader, identifier, currentWebChallenge); 57 62 } 58 63 59 64 void ResourceLoadNotifier::didCancelAuthenticationChallenge(ResourceLoader* loader, const AuthenticationChallenge& currentWebChallenge) 60 65 { 61 m_frame.loader().client().dispatchDidCancelAuthenticationChallenge(loader->documentLoader(), loader->identifier(), currentWebChallenge); 66 didCancelAuthenticationChallenge(loader->identifier(), loader->documentLoader(), currentWebChallenge); 67 } 68 69 void ResourceLoadNotifier::didCancelAuthenticationChallenge(unsigned long identifier, DocumentLoader* loader, const AuthenticationChallenge& currentWebChallenge) 70 { 71 m_frame.loader().client().dispatchDidCancelAuthenticationChallenge(loader, identifier, currentWebChallenge); 62 72 } 63 73 -
trunk/Source/WebCore/loader/ResourceLoadNotifier.h
r157007 r161455 50 50 51 51 void didReceiveAuthenticationChallenge(ResourceLoader*, const AuthenticationChallenge&); 52 void didReceiveAuthenticationChallenge(unsigned long identifier, DocumentLoader*, const AuthenticationChallenge&); 52 53 void didCancelAuthenticationChallenge(ResourceLoader*, const AuthenticationChallenge&); 54 void didCancelAuthenticationChallenge(unsigned long identifier, DocumentLoader*, const AuthenticationChallenge&); 53 55 54 56 void willSendRequest(ResourceLoader*, ResourceRequest&, const ResourceResponse& redirectResponse); -
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
r160577 r161455 1272 1272 #endif 1273 1273 1274 bool MediaPlayer::shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge& challenge) 1275 { 1276 if (!m_mediaPlayerClient) 1277 return false; 1278 1279 return m_mediaPlayerClient->mediaPlayerShouldWaitForResponseToAuthenticationChallenge(challenge); 1280 } 1281 1274 1282 void MediaPlayerFactorySupport::callRegisterMediaEngine(MediaEngineRegister registerMediaEngine) 1275 1283 { -
trunk/Source/WebCore/platform/graphics/MediaPlayer.h
r160336 r161455 69 69 70 70 class AudioSourceProvider; 71 class AuthenticationChallenge; 71 72 class Document; 72 73 #if ENABLE(MEDIA_SOURCE) … … 253 254 virtual void textTrackRepresentationBoundsChanged(const IntRect&) { } 254 255 #endif 256 257 virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) { return false; } 255 258 }; 256 259 … … 521 524 double totalFrameDelay(); 522 525 #endif 526 527 bool shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&); 523 528 524 529 private: -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
r159827 r161455 43 43 OBJC_CLASS AVURLAsset; 44 44 OBJC_CLASS NSArray; 45 OBJC_CLASS NSURLAuthenticationChallenge; 45 46 OBJC_CLASS WebCoreAVFMovieObserver; 46 47 OBJC_CLASS WebCoreAVFPullDelegate; … … 81 82 #if HAVE(AVFOUNDATION_LOADER_DELEGATE) 82 83 bool shouldWaitForLoadingOfResource(AVAssetResourceLoadingRequest*); 84 bool shouldWaitForResponseToAuthenticationChallenge(NSURLAuthenticationChallenge*); 83 85 void didCancelLoadingRequest(AVAssetResourceLoadingRequest*); 84 86 void didStopLoadingRequest(AVAssetResourceLoadingRequest *); -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r159827 r161455 30 30 #import "MediaPlayerPrivateAVFoundationObjC.h" 31 31 32 #import "AVTrackPrivateAVFObjCImpl.h" 32 33 #import "AudioTrackPrivateAVFObjC.h" 33 #import "A VTrackPrivateAVFObjCImpl.h"34 #import "AuthenticationChallenge.h" 34 35 #import "BlockExceptions.h" 35 36 #import "ExceptionCodePlaceholder.h" … … 1018 1019 } 1019 1020 1021 bool MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge(NSURLAuthenticationChallenge* nsChallenge) 1022 { 1023 AuthenticationChallenge challenge(nsChallenge); 1024 1025 return player()->shouldWaitForResponseToAuthenticationChallenge(challenge); 1026 } 1027 1020 1028 void MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest(AVAssetResourceLoadingRequest* avRequest) 1021 1029 { … … 2050 2058 } 2051 2059 2060 - (BOOL)resourceLoader:(AVAssetResourceLoader *)resourceLoader shouldWaitForResponseToAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge 2061 { 2062 UNUSED_PARAM(resourceLoader); 2063 if (!m_callback) 2064 return NO; 2065 2066 dispatch_async(dispatch_get_main_queue(), ^{ 2067 if (!m_callback) { 2068 [[challenge sender] cancelAuthenticationChallenge:challenge]; 2069 return; 2070 } 2071 2072 if (!m_callback->shouldWaitForResponseToAuthenticationChallenge(challenge)) 2073 [[challenge sender] cancelAuthenticationChallenge:challenge]; 2074 }); 2075 2076 return YES; 2077 } 2078 2052 2079 - (void)resourceLoader:(AVAssetResourceLoader *)resourceLoader didCancelLoadingRequest:(AVAssetResourceLoadingRequest *)loadingRequest 2053 2080 {
Note: See TracChangeset
for help on using the changeset viewer.