<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[161455] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/161455">161455</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2014-01-07 14:24:37 -0800 (Tue, 07 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadNotifiercpp">trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadNotifierh">trunk/Source/WebCore/loader/ResourceLoadNotifier.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsmediaresourcesvideoauthphp">trunk/LayoutTests/http/tests/media/resources/video-auth.php</a></li>
<li><a href="#trunkLayoutTestshttptestsmediavideoauthexpectedtxt">trunk/LayoutTests/http/tests/media/video-auth-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsmediavideoauthhtml">trunk/LayoutTests/http/tests/media/video-auth.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/LayoutTests/ChangeLog        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-01-06 Jer Noble <jer.noble@apple.com>
+
+ 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.
+
+ * 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:
+
</ins><span class="cx"> 2014-01-07 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed test expectation update.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsmediaresourcesvideoauthphp"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/media/resources/video-auth.php (0 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/media/resources/video-auth.php         (rev 0)
+++ trunk/LayoutTests/http/tests/media/resources/video-auth.php        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+<?php
+
+ $ua = $_SERVER["HTTP_USER_AGENT"];
+
+        header("Cache-Control: no-store");
+        header("Connection: close");
+        if (!isset($_SERVER['PHP_AUTH_USER'])) {
+         header("WWW-authenticate: Basic realm=\"" . $_SERVER['REQUEST_URI'] . "\"");
+         header('HTTP/1.0 401 Unauthorized');
+         exit;
+        }
+
+ $fileName = $_GET["name"];
+ $type = $_GET["type"];
+
+ $_GET = array();
+ $_GET['name'] = $fileName;
+ $_GET['type'] = $type;
+ @include("./serve-video.php");
+?>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsmediavideoauthexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/media/video-auth-expected.txt (0 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/media/video-auth-expected.txt         (rev 0)
+++ trunk/LayoutTests/http/tests/media/video-auth-expected.txt        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+http://127.0.0.1:8000/media/resources/video-auth.php?name=test.mp4&type=video/mp4 - didReceiveAuthenticationChallenge - Responding with username:password
+
+Tests that the media player sends authorization credentials when requesting a media file.
+EVENT(canplay)
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsmediavideoauthhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/media/video-auth.html (0 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/media/video-auth.html         (rev 0)
+++ trunk/LayoutTests/http/tests/media/video-auth.html        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<html>
+ <head>
+ <script src=../../media-resources/video-test.js></script>
+ <script src=../../media-resources/media-file.js></script>
+ <script>
+
+ if (window.testRunner) {
+ testRunner.setHandlesAuthenticationChallenges(true);
+ testRunner.setAuthenticationUsername("username");
+ testRunner.setAuthenticationPassword("password");
+ }
+
+ function loadMediaFrame()
+ {
+ findMediaElement();
+
+ var movie = findMediaFile('video', 'test');
+ var type = mimeTypeForExtension(movie.split('.').pop());
+ var frame = document.createElement('iframe');
+ frame.width = 0;
+ frame.height = 0;
+ frame.addEventListener('load', function () {
+ source = document.getElementById('source');
+ source.src = 'http://127.0.0.1:8000/media/resources/video-auth.php?name=' + movie + '&type=' + type;
+ source.type = type;
+
+ waitForEventAndFail('error');
+ waitForEventAndEnd('canplay');
+ video.load();
+ });
+
+ frame.src = "data:text/html,<b>test</b>";
+ document.body.appendChild(frame);
+ }
+ </script>
+ </head>
+
+ <body onload="loadMediaFrame()">
+ <video id="video">
+ <source id="source">
+ </video>
+ <br>
+ Tests that the media player sends authorization credentials when requesting a media file.
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -1313,3 +1313,6 @@
</span><span class="cx"> # GL Scissors don't work properly in Mountain Lion.
</span><span class="cx"> webkit.org/b/126455 [ MountainLion ] webgl/1.0.2/conformance/rendering/gl-scissor-test.html [ Failure ]
</span><span class="cx"> webkit.org/b/126586 [ Mavericks Debug] webgl/1.0.2/conformance/rendering/gl-scissor-test.html [ Pass Failure ]
</span><ins>+
+# HTTP Auth in Media is not supported in Mavericks and Mountain Lion
+webkit.org/b/40382 http/tests/media/video-auth.html [ Skip ]
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/Source/WebCore/ChangeLog        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2014-01-06 Jer Noble <jer.noble@apple.com>
+
+ 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.
+
+ 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:]):
+
</ins><span class="cx"> 2014-01-07 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r161447.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> #include "MIMETypeRegistry.h"
</span><span class="cx"> #include "PageActivityAssertionToken.h"
</span><span class="cx"> #include "PageGroup.h"
</span><ins>+#include "ProgressTracker.h"
</ins><span class="cx"> #include "RenderVideo.h"
</span><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "ScriptController.h"
</span><span class="lines">@@ -5577,6 +5578,27 @@
</span><span class="cx"> return mediaPlayerOwningDocument()->cachedResourceLoader();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge& challenge)
+{
+ Frame* frame = document().frame();
+ if (!frame)
+ return false;
+
+ Page* page = frame->page();
+ if (!page)
+ return false;
+
+ ResourceRequest request(m_currentSrc);
+ ResourceLoadNotifier& notifier = frame->loader().notifier();
+ DocumentLoader* documentLoader = document().loader();
+ unsigned long identifier = page->progress().createUniqueIdentifier();
+
+ notifier.assignIdentifierToInitialRequest(identifier, documentLoader, request);
+ notifier.didReceiveAuthenticationChallenge(identifier, documentLoader, challenge);
+
+ return true;
+}
+
</ins><span class="cx"> void HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture()
</span><span class="cx"> {
</span><span class="cx"> m_restrictions = NoRestrictions;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -584,6 +584,8 @@
</span><span class="cx"> virtual GraphicsDeviceAdapter* mediaPlayerGraphicsDeviceAdapter(const MediaPlayer*) const OVERRIDE;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) OVERRIDE;
+
</ins><span class="cx"> void loadTimerFired(Timer<HTMLMediaElement>*);
</span><span class="cx"> void progressEventTimerFired(Timer<HTMLMediaElement>*);
</span><span class="cx"> void playbackProgressTimerFired(Timer<HTMLMediaElement>*);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadNotifiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -53,14 +53,24 @@
</span><span class="cx">
</span><span class="cx"> void ResourceLoadNotifier::didReceiveAuthenticationChallenge(ResourceLoader* loader, const AuthenticationChallenge& currentWebChallenge)
</span><span class="cx"> {
</span><del>- m_frame.loader().client().dispatchDidReceiveAuthenticationChallenge(loader->documentLoader(), loader->identifier(), currentWebChallenge);
</del><ins>+ didReceiveAuthenticationChallenge(loader->identifier(), loader->documentLoader(), currentWebChallenge);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void ResourceLoadNotifier::didReceiveAuthenticationChallenge(unsigned long identifier, DocumentLoader* loader, const AuthenticationChallenge& currentWebChallenge)
+{
+ m_frame.loader().client().dispatchDidReceiveAuthenticationChallenge(loader, identifier, currentWebChallenge);
+}
+
</ins><span class="cx"> void ResourceLoadNotifier::didCancelAuthenticationChallenge(ResourceLoader* loader, const AuthenticationChallenge& currentWebChallenge)
</span><span class="cx"> {
</span><del>- m_frame.loader().client().dispatchDidCancelAuthenticationChallenge(loader->documentLoader(), loader->identifier(), currentWebChallenge);
</del><ins>+ didCancelAuthenticationChallenge(loader->identifier(), loader->documentLoader(), currentWebChallenge);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void ResourceLoadNotifier::didCancelAuthenticationChallenge(unsigned long identifier, DocumentLoader* loader, const AuthenticationChallenge& currentWebChallenge)
+{
+ m_frame.loader().client().dispatchDidCancelAuthenticationChallenge(loader, identifier, currentWebChallenge);
+}
+
</ins><span class="cx"> void ResourceLoadNotifier::willSendRequest(ResourceLoader* loader, ResourceRequest& clientRequest, const ResourceResponse& redirectResponse)
</span><span class="cx"> {
</span><span class="cx"> m_frame.loader().applyUserAgent(clientRequest);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadNotifierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoadNotifier.h (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoadNotifier.h        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/Source/WebCore/loader/ResourceLoadNotifier.h        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -49,7 +49,9 @@
</span><span class="cx"> explicit ResourceLoadNotifier(Frame&);
</span><span class="cx">
</span><span class="cx"> void didReceiveAuthenticationChallenge(ResourceLoader*, const AuthenticationChallenge&);
</span><ins>+ void didReceiveAuthenticationChallenge(unsigned long identifier, DocumentLoader*, const AuthenticationChallenge&);
</ins><span class="cx"> void didCancelAuthenticationChallenge(ResourceLoader*, const AuthenticationChallenge&);
</span><ins>+ void didCancelAuthenticationChallenge(unsigned long identifier, DocumentLoader*, const AuthenticationChallenge&);
</ins><span class="cx">
</span><span class="cx"> void willSendRequest(ResourceLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
</span><span class="cx"> void didReceiveResponse(ResourceLoader*, const ResourceResponse&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -1271,6 +1271,14 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+bool MediaPlayer::shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge& challenge)
+{
+ if (!m_mediaPlayerClient)
+ return false;
+
+ return m_mediaPlayerClient->mediaPlayerShouldWaitForResponseToAuthenticationChallenge(challenge);
+}
+
</ins><span class="cx"> void MediaPlayerFactorySupport::callRegisterMediaEngine(MediaEngineRegister registerMediaEngine)
</span><span class="cx"> {
</span><span class="cx"> registerMediaEngine(addMediaEngine);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class AudioSourceProvider;
</span><ins>+class AuthenticationChallenge;
</ins><span class="cx"> class Document;
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx"> class HTMLMediaSource;
</span><span class="lines">@@ -252,6 +253,8 @@
</span><span class="cx">
</span><span class="cx"> virtual void textTrackRepresentationBoundsChanged(const IntRect&) { }
</span><span class="cx"> #endif
</span><ins>+
+ virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) { return false; }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class MediaPlayerSupportsTypeClient {
</span><span class="lines">@@ -521,6 +524,8 @@
</span><span class="cx"> double totalFrameDelay();
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ bool shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&);
+
</ins><span class="cx"> private:
</span><span class="cx"> MediaPlayer(MediaPlayerClient*);
</span><span class="cx"> MediaPlayerFactory* nextBestMediaEngine(MediaPlayerFactory*) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> OBJC_CLASS AVPlayerLayer;
</span><span class="cx"> OBJC_CLASS AVURLAsset;
</span><span class="cx"> OBJC_CLASS NSArray;
</span><ins>+OBJC_CLASS NSURLAuthenticationChallenge;
</ins><span class="cx"> OBJC_CLASS WebCoreAVFMovieObserver;
</span><span class="cx"> OBJC_CLASS WebCoreAVFPullDelegate;
</span><span class="cx">
</span><span class="lines">@@ -80,6 +81,7 @@
</span><span class="cx">
</span><span class="cx"> #if HAVE(AVFOUNDATION_LOADER_DELEGATE)
</span><span class="cx"> bool shouldWaitForLoadingOfResource(AVAssetResourceLoadingRequest*);
</span><ins>+ bool shouldWaitForResponseToAuthenticationChallenge(NSURLAuthenticationChallenge*);
</ins><span class="cx"> void didCancelLoadingRequest(AVAssetResourceLoadingRequest*);
</span><span class="cx"> void didStopLoadingRequest(AVAssetResourceLoadingRequest *);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (161454 => 161455)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-01-07 22:06:08 UTC (rev 161454)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-01-07 22:24:37 UTC (rev 161455)
</span><span class="lines">@@ -29,8 +29,9 @@
</span><span class="cx">
</span><span class="cx"> #import "MediaPlayerPrivateAVFoundationObjC.h"
</span><span class="cx">
</span><ins>+#import "AVTrackPrivateAVFObjCImpl.h"
</ins><span class="cx"> #import "AudioTrackPrivateAVFObjC.h"
</span><del>-#import "AVTrackPrivateAVFObjCImpl.h"
</del><ins>+#import "AuthenticationChallenge.h"
</ins><span class="cx"> #import "BlockExceptions.h"
</span><span class="cx"> #import "ExceptionCodePlaceholder.h"
</span><span class="cx"> #import "FloatConversion.h"
</span><span class="lines">@@ -1017,6 +1018,13 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge(NSURLAuthenticationChallenge* nsChallenge)
+{
+ AuthenticationChallenge challenge(nsChallenge);
+
+ return player()->shouldWaitForResponseToAuthenticationChallenge(challenge);
+}
+
</ins><span class="cx"> void MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest(AVAssetResourceLoadingRequest* avRequest)
</span><span class="cx"> {
</span><span class="cx"> String scheme = [[[avRequest request] URL] scheme];
</span><span class="lines">@@ -2049,6 +2057,25 @@
</span><span class="cx"> return YES;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (BOOL)resourceLoader:(AVAssetResourceLoader *)resourceLoader shouldWaitForResponseToAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+ UNUSED_PARAM(resourceLoader);
+ if (!m_callback)
+ return NO;
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (!m_callback) {
+ [[challenge sender] cancelAuthenticationChallenge:challenge];
+ return;
+ }
+
+ if (!m_callback->shouldWaitForResponseToAuthenticationChallenge(challenge))
+ [[challenge sender] cancelAuthenticationChallenge:challenge];
+ });
+
+ return YES;
+}
+
</ins><span class="cx"> - (void)resourceLoader:(AVAssetResourceLoader *)resourceLoader didCancelLoadingRequest:(AVAssetResourceLoadingRequest *)loadingRequest
</span><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(resourceLoader);
</span></span></pre>
</div>
</div>
</body>
</html>