<!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>[199326] trunk/Source</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/199326">199326</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-04-11 18:00:07 -0700 (Mon, 11 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>When clearing cache, also clear AVFoundation cache.
https://bugs.webkit.org/show_bug.cgi?id=155783
rdar://problem/25252541

Patch by Jeremy Jones &lt;jeremyj@apple.com&gt; on 2016-04-11
Reviewed by Darin Adler.

Source/WebCore:

Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
can then be used to manage the cache storage used by AVFoundation. It is used to query the
contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
clearMediaCache() and clearMediaCacheForOrigins().

Use SecurityOrigin instead of the less formal site String to represent origins in the cache.

* html/HTMLMediaElement.cpp:
(WebCore::sharedMediaCacheDirectory): Added.
(WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
(WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
(WebCore::HTMLMediaElement::originsInMediaCache): Added.
(WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
(WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
(WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
(WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
(WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
* platform/graphics/MediaPlayer.cpp:
(WebCore::addMediaEngine): Add new cache methods.
(WebCore::addToHash): Added.
(WebCore::MediaPlayer::originsInMediaCache): Added.
(WebCore::MediaPlayer::clearMediaCache): Added parameter.
(WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
(WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
(WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
(WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
(WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
(WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
(WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
(WebCore::assetCacheForPath): Added.
(WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
(WebCore::toSystemClockTime): Added.
(WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
(WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
(WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
(WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
(WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
(WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
(WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
* platform/spi/mac/AVFoundationSPI.h:

Source/WebKit2:

Include the HTMLMediaElement media cache when doing disk cache operations.
Add a sandbox extension for media cache directory. This allows the UI process and the web process
to access the same cache.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode): Add media cache directory.
(WebKit::WebProcessCreationParameters::decode): Add media cache directory.
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add media cache directory.
(API::ProcessPoolConfiguration::copy): Add media cache directory.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::defaultMediaCacheDirectory): Default implementation.
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultMediaCacheDirectory): Media cache is in temporary directory.
(API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): For resources in temporary directory.
(API::WebsiteDataStore::defaultDataStoreConfiguration): Init media cache directory.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration): Add mediaCacheDirectory.
(WebKit::WebProcessPool::createNewWebProcess): Add mediaCacheDirectory.
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::fetchData): Implement for mediaCacheDirectory.
(WebKit::WebsiteDataStore::removeData): Implement for mediaCacheDirectory.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/efl/WebProcessPoolEfl.cpp:
(WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Initialize media cache directory.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess): Consume sandbox extension.</pre>

<h3>Modified Paths</h3>
<ul>
<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="#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="#trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.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>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformspimacAVFoundationSPIh">trunk/Source/WebCore/platform/spi/mac/AVFoundationSPI.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParameterscpp">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParametersh">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationcpp">trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationh">trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIWebsiteDataStorecpp">trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIWebsiteDataStoreh">trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaAPIWebsiteDataStoreCocoamm">trunk/Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebProcessPoolCocoamm">trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolh">trunk/Source/WebKit2/UIProcess/WebProcessPool.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp">trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStoreh">trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcesseflWebProcessPoolEflcpp">trunk/Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebProcessPoolGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm">trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/ChangeLog        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2016-04-11  Jeremy Jones  &lt;jeremyj@apple.com&gt;
+
+        When clearing cache, also clear AVFoundation cache.
+        https://bugs.webkit.org/show_bug.cgi?id=155783
+        rdar://problem/25252541
+
+        Reviewed by Darin Adler.
+
+        Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
+        can then be used to manage the cache storage used by AVFoundation. It is used to query the
+        contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
+        clearMediaCache() and clearMediaCacheForOrigins().
+
+        Use SecurityOrigin instead of the less formal site String to represent origins in the cache.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::sharedMediaCacheDirectory): Added.
+        (WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
+        (WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
+        (WebCore::HTMLMediaElement::originsInMediaCache): Added.
+        (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
+        (WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
+        (WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
+        (WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
+        (WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
+        * html/HTMLMediaElement.h:
+        (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::addMediaEngine): Add new cache methods.
+        (WebCore::addToHash): Added.
+        (WebCore::MediaPlayer::originsInMediaCache): Added.
+        (WebCore::MediaPlayer::clearMediaCache): Added parameter.
+        (WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
+        (WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
+        (WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
+        * platform/graphics/MediaPlayer.h:
+        (WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
+        (WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
+        (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
+        (WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
+        (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
+        (WebCore::assetCacheForPath): Added.
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
+        (WebCore::toSystemClockTime): Added.
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
+        (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
+        (WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
+        (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
+        (WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
+        (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
+        * platform/spi/mac/AVFoundationSPI.h:
+
</ins><span class="cx"> 2016-04-11  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r199310.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -5593,23 +5593,38 @@
</span><span class="cx">     else
</span><span class="cx">         document().decrementLoadEventDelayCount();
</span><span class="cx"> }
</span><del>-    
</del><span class="cx"> 
</span><del>-void HTMLMediaElement::getSitesInMediaCache(Vector&lt;String&gt;&amp; sites)
</del><ins>+static String&amp; sharedMediaCacheDirectory()
</ins><span class="cx"> {
</span><del>-    MediaPlayer::getSitesInMediaCache(sites);
</del><ins>+    static NeverDestroyed&lt;String&gt; sharedMediaCacheDirectory;
+    return sharedMediaCacheDirectory;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::clearMediaCache()
</del><ins>+void HTMLMediaElement::setMediaCacheDirectory(const String&amp; path)
</ins><span class="cx"> {
</span><del>-    MediaPlayer::clearMediaCache();
</del><ins>+    sharedMediaCacheDirectory() = path;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::clearMediaCacheForSite(const String&amp; site)
</del><ins>+const String&amp; HTMLMediaElement::mediaCacheDirectory()
</ins><span class="cx"> {
</span><del>-    MediaPlayer::clearMediaCacheForSite(site);
</del><ins>+    return sharedMediaCacheDirectory();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; HTMLMediaElement::originsInMediaCache(const String&amp; path)
+{
+    return MediaPlayer::originsInMediaCache(path);
+}
+
+void HTMLMediaElement::clearMediaCache(const String&amp; path, std::chrono::system_clock::time_point modifiedSince)
+{
+    MediaPlayer::clearMediaCache(path, modifiedSince);
+}
+
+void HTMLMediaElement::clearMediaCacheForOrigins(const String&amp; path, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp; origins)
+{
+    MediaPlayer::clearMediaCacheForOrigins(path, origins);
+}
+
</ins><span class="cx"> void HTMLMediaElement::resetMediaEngines()
</span><span class="cx"> {
</span><span class="cx">     MediaPlayer::resetMediaEngines();
</span><span class="lines">@@ -6192,6 +6207,11 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const String&amp; HTMLMediaElement::mediaPlayerMediaCacheDirectory() const
+{
+    return mediaCacheDirectory();
+}
+
</ins><span class="cx"> bool HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&amp; challenge)
</span><span class="cx"> {
</span><span class="cx">     Frame* frame = document().frame();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -380,9 +380,11 @@
</span><span class="cx">     void privateBrowsingStateDidChange() override;
</span><span class="cx"> 
</span><span class="cx">     // Media cache management.
</span><del>-    WEBCORE_EXPORT static void getSitesInMediaCache(Vector&lt;String&gt;&amp;);
-    WEBCORE_EXPORT static void clearMediaCache();
-    WEBCORE_EXPORT static void clearMediaCacheForSite(const String&amp;);
</del><ins>+    WEBCORE_EXPORT static void setMediaCacheDirectory(const String&amp;);
+    WEBCORE_EXPORT static const String&amp; mediaCacheDirectory();
+    WEBCORE_EXPORT static HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; originsInMediaCache(const String&amp;);
+    WEBCORE_EXPORT static void clearMediaCache(const String&amp;, std::chrono::system_clock::time_point modifiedSince = { });
+    WEBCORE_EXPORT static void clearMediaCacheForOrigins(const String&amp;, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp;);
</ins><span class="cx">     static void resetMediaEngines();
</span><span class="cx"> 
</span><span class="cx">     bool isPlaying() const { return m_playing; }
</span><span class="lines">@@ -597,6 +599,7 @@
</span><span class="cx">     CachedResourceLoader* mediaPlayerCachedResourceLoader() override;
</span><span class="cx">     RefPtr&lt;PlatformMediaResourceLoader&gt; mediaPlayerCreateResourceLoader() override;
</span><span class="cx">     bool mediaPlayerShouldUsePersistentCache() const override;
</span><ins>+    const String&amp; mediaPlayerMediaCacheDirectory() const override;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN) &amp;&amp; USE(AVFOUNDATION)
</span><span class="cx">     GraphicsDeviceAdapter* mediaPlayerGraphicsDeviceAdapter(const MediaPlayer*) const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -170,13 +170,13 @@
</span><span class="cx">     CreateMediaEnginePlayer constructor;
</span><span class="cx">     MediaEngineSupportedTypes getSupportedTypes;
</span><span class="cx">     MediaEngineSupportsType supportsTypeAndCodecs;
</span><del>-    MediaEngineGetSitesInMediaCache getSitesInMediaCache;
</del><ins>+    MediaEngineOriginsInMediaCache originsInMediaCache;
</ins><span class="cx">     MediaEngineClearMediaCache clearMediaCache;
</span><del>-    MediaEngineClearMediaCacheForSite clearMediaCacheForSite;
</del><ins>+    MediaEngineClearMediaCacheForOrigins clearMediaCacheForOrigins;
</ins><span class="cx">     MediaEngineSupportsKeySystem supportsKeySystem;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static void addMediaEngine(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem);
</del><ins>+static void addMediaEngine(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineOriginsInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForOrigins, MediaEngineSupportsKeySystem);
</ins><span class="cx"> 
</span><span class="cx"> static bool haveMediaEnginesVector;
</span><span class="cx"> 
</span><span class="lines">@@ -234,13 +234,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void addMediaEngine(CreateMediaEnginePlayer constructor, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsType,
</span><del>-    MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem)
</del><ins>+    MediaEngineOriginsInMediaCache originsInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForOrigins clearMediaCacheForOrigins, MediaEngineSupportsKeySystem supportsKeySystem)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(constructor);
</span><span class="cx">     ASSERT(getSupportedTypes);
</span><span class="cx">     ASSERT(supportsType);
</span><span class="cx"> 
</span><del>-    mutableInstalledMediaEnginesVector().append(MediaPlayerFactory { constructor, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, supportsKeySystem });
</del><ins>+    mutableInstalledMediaEnginesVector().append(MediaPlayerFactory { constructor, getSupportedTypes, supportsType, originsInMediaCache, clearMediaCache, clearMediaCacheForOrigins, supportsKeySystem });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const AtomicString&amp; applicationOctetStream()
</span><span class="lines">@@ -1042,30 +1042,39 @@
</span><span class="cx">     loadWithNextMediaEngine(m_currentMediaEngine);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayer::getSitesInMediaCache(Vector&lt;String&gt;&amp; sites)
</del><ins>+template&lt;typename T&gt;
+static void addToHash(HashSet&lt;T&gt;&amp; toHash, HashSet&lt;T&gt;&amp;&amp; fromHash)
</ins><span class="cx"> {
</span><ins>+    if (toHash.isEmpty())
+        toHash = WTFMove(fromHash);
+    else
+        toHash.add(fromHash.begin(), fromHash.end());
+}
+    
+HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; MediaPlayer::originsInMediaCache(const String&amp; path)
+{
+    HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; origins;
</ins><span class="cx">     for (auto&amp; engine : installedMediaEngines()) {
</span><del>-        if (!engine.getSitesInMediaCache)
</del><ins>+        if (!engine.originsInMediaCache)
</ins><span class="cx">             continue;
</span><del>-        Vector&lt;String&gt; engineSites;
-        engine.getSitesInMediaCache(engineSites);
-        sites.appendVector(engineSites);
</del><ins>+        addToHash(origins, engine.originsInMediaCache(path));
</ins><span class="cx">     }
</span><ins>+    return origins;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayer::clearMediaCache()
</del><ins>+void MediaPlayer::clearMediaCache(const String&amp; path, std::chrono::system_clock::time_point modifiedSince)
</ins><span class="cx"> {
</span><span class="cx">     for (auto&amp; engine : installedMediaEngines()) {
</span><span class="cx">         if (engine.clearMediaCache)
</span><del>-            engine.clearMediaCache();
</del><ins>+            engine.clearMediaCache(path, modifiedSince);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayer::clearMediaCacheForSite(const String&amp; site)
</del><ins>+void MediaPlayer::clearMediaCacheForOrigins(const String&amp; path, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp; origins)
</ins><span class="cx"> {
</span><span class="cx">     for (auto&amp; engine : installedMediaEngines()) {
</span><del>-        if (engine.clearMediaCacheForSite)
-            engine.clearMediaCacheForSite(site);
</del><ins>+        if (engine.clearMediaCacheForOrigins)
+            engine.clearMediaCacheForOrigins(path, origins);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;PlatformLayer.h&quot;
</span><span class="cx"> #include &quot;PlatformMediaResourceLoader.h&quot;
</span><span class="cx"> #include &quot;PlatformMediaSession.h&quot;
</span><ins>+#include &quot;SecurityOriginHash.h&quot;
</ins><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="cx"> #include &quot;VideoTrackPrivate.h&quot;
</span><span class="cx"> #include &lt;runtime/Uint8Array.h&gt;
</span><span class="lines">@@ -236,6 +237,7 @@
</span><span class="cx">     virtual RefPtr&lt;PlatformMediaResourceLoader&gt; mediaPlayerCreateResourceLoader() { return nullptr; }
</span><span class="cx">     virtual bool doesHaveAttribute(const AtomicString&amp;, AtomicString* = 0) const { return false; }
</span><span class="cx">     virtual bool mediaPlayerShouldUsePersistentCache() const { return true; }
</span><ins>+    virtual const String&amp; mediaPlayerMediaCacheDirectory() const { return emptyString(); }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     virtual void mediaPlayerDidAddAudioTrack(PassRefPtr&lt;AudioTrackPrivate&gt;) { }
</span><span class="lines">@@ -292,9 +294,9 @@
</span><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;, const MediaPlayerSupportsTypeClient*);
</span><span class="cx">     static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp;);
</span><span class="cx">     static bool isAvailable();
</span><del>-    static void getSitesInMediaCache(Vector&lt;String&gt;&amp;);
-    static void clearMediaCache();
-    static void clearMediaCacheForSite(const String&amp;);
</del><ins>+    static HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; originsInMediaCache(const String&amp; path);
+    static void clearMediaCache(const String&amp; path, std::chrono::system_clock::time_point modifiedSince);
+    static void clearMediaCacheForOrigins(const String&amp; path, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp;);
</ins><span class="cx">     static bool supportsKeySystem(const String&amp; keySystem, const String&amp; mimeType);
</span><span class="cx"> 
</span><span class="cx">     bool supportsFullscreen() const;
</span><span class="lines">@@ -630,13 +632,13 @@
</span><span class="cx"> typedef std::function&lt;std::unique_ptr&lt;MediaPlayerPrivateInterface&gt; (MediaPlayer*)&gt; CreateMediaEnginePlayer;
</span><span class="cx"> typedef void (*MediaEngineSupportedTypes)(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</span><span class="cx"> typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const MediaEngineSupportParameters&amp; parameters);
</span><del>-typedef void (*MediaEngineGetSitesInMediaCache)(Vector&lt;String&gt;&amp;);
-typedef void (*MediaEngineClearMediaCache)();
-typedef void (*MediaEngineClearMediaCacheForSite)(const String&amp;);
</del><ins>+typedef HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; (*MediaEngineOriginsInMediaCache)(const String&amp; path);
+typedef void (*MediaEngineClearMediaCache)(const String&amp; path, std::chrono::system_clock::time_point modifiedSince);
+typedef void (*MediaEngineClearMediaCacheForOrigins)(const String&amp; path, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp;);
</ins><span class="cx"> typedef bool (*MediaEngineSupportsKeySystem)(const String&amp; keySystem, const String&amp; mimeType);
</span><span class="cx"> 
</span><span class="cx"> typedef void (*MediaEngineRegistrar)(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType,
</span><del>-    MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem);
</del><ins>+    MediaEngineOriginsInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForOrigins, MediaEngineSupportsKeySystem);
</ins><span class="cx"> typedef void (*MediaEngineRegister)(MediaEngineRegistrar);
</span><span class="cx"> 
</span><span class="cx"> class MediaPlayerFactorySupport {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -214,9 +214,9 @@
</span><span class="cx">     virtual unsigned audioDecodedByteCount() const { return 0; }
</span><span class="cx">     virtual unsigned videoDecodedByteCount() const { return 0; }
</span><span class="cx"> 
</span><del>-    void getSitesInMediaCache(Vector&lt;String&gt;&amp;) { }
-    void clearMediaCache() { }
-    void clearMediaCacheForSite(const String&amp;) { }
</del><ins>+    HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; originsInMediaCache(const String&amp;) { return { }; }
+    void clearMediaCache(const String&amp;, std::chrono::system_clock::time_point) { }
+    void clearMediaCacheForOrigins(const String&amp;, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp;) { }
</ins><span class="cx"> 
</span><span class="cx">     virtual void setPrivateBrowsingMode(bool) { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -87,6 +87,10 @@
</span><span class="cx"> 
</span><span class="cx">     static void registerMediaEngine(MediaEngineRegistrar);
</span><span class="cx"> 
</span><ins>+    static HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; originsInMediaCache(const String&amp;);
+    static void clearMediaCache(const String&amp;, std::chrono::system_clock::time_point modifiedSince);
+    static void clearMediaCacheForOrigins(const String&amp;, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp;);
+
</ins><span class="cx">     void setAsset(RetainPtr&lt;id&gt;);
</span><span class="cx">     void tracksChanged() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -158,6 +158,7 @@
</span><span class="cx"> SOFT_LINK_CLASS(AVFoundation, AVURLAsset)
</span><span class="cx"> SOFT_LINK_CLASS(AVFoundation, AVAssetImageGenerator)
</span><span class="cx"> SOFT_LINK_CLASS(AVFoundation, AVMetadataItem)
</span><ins>+SOFT_LINK_CLASS(AVFoundation, AVAssetCache)
</ins><span class="cx"> 
</span><span class="cx"> SOFT_LINK_CLASS(CoreImage, CIContext)
</span><span class="cx"> SOFT_LINK_CLASS(CoreImage, CIImage)
</span><span class="lines">@@ -227,6 +228,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(AVF_CAPTIONS)
</span><ins>+SOFT_LINK_POINTER(AVFoundation, AVURLAssetCacheKey, NSString*)
</ins><span class="cx"> SOFT_LINK_POINTER(AVFoundation, AVURLAssetHTTPCookiesKey, NSString*)
</span><span class="cx"> SOFT_LINK_POINTER(AVFoundation, AVURLAssetOutOfBandAlternateTracksKey, NSString*)
</span><span class="cx"> SOFT_LINK_POINTER(AVFoundation, AVURLAssetUsesNoPersistentCacheKey, NSString*)
</span><span class="lines">@@ -242,6 +244,7 @@
</span><span class="cx"> 
</span><span class="cx"> #define AVURLAssetHTTPCookiesKey getAVURLAssetHTTPCookiesKey()
</span><span class="cx"> #define AVURLAssetOutOfBandAlternateTracksKey getAVURLAssetOutOfBandAlternateTracksKey()
</span><ins>+#define AVURLAssetCacheKey getAVURLAssetCacheKey()
</ins><span class="cx"> #define AVURLAssetUsesNoPersistentCacheKey getAVURLAssetUsesNoPersistentCacheKey()
</span><span class="cx"> #define AVOutOfBandAlternateTrackDisplayNameKey getAVOutOfBandAlternateTrackDisplayNameKey()
</span><span class="cx"> #define AVOutOfBandAlternateTrackExtendedLanguageTagKey getAVOutOfBandAlternateTrackExtendedLanguageTagKey()
</span><span class="lines">@@ -422,9 +425,97 @@
</span><span class="cx"> {
</span><span class="cx">     if (isAvailable())
</span><span class="cx">         registrar([](MediaPlayer* player) { return std::make_unique&lt;MediaPlayerPrivateAVFoundationObjC&gt;(player); },
</span><del>-            getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem);
</del><ins>+            getSupportedTypes, supportsType, originsInMediaCache, clearMediaCache, clearMediaCacheForOrigins, supportsKeySystem);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static AVAssetCache *assetCacheForPath(const String&amp; path)
+{
+    NSURL *assetCacheURL;
+    
+    if (path.isEmpty())
+        assetCacheURL = [[NSURL fileURLWithPath:NSTemporaryDirectory()] URLByAppendingPathComponent:@&quot;MediaCache&quot; isDirectory:YES];
+    else
+        assetCacheURL = [NSURL fileURLWithPath:path isDirectory:YES];
+
+    return [getAVAssetCacheClass() assetCacheWithURL:assetCacheURL];
+}
+
+HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; MediaPlayerPrivateAVFoundationObjC::originsInMediaCache(const String&amp; path)
+{
+    HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; origins;
+    for (NSString *key in [assetCacheForPath(path) allKeys]) {
+        URL keyAsURL = URL(URL(), key);
+        if (keyAsURL.isValid())
+            origins.add(SecurityOrigin::create(keyAsURL));
+    }
+    return origins;
+}
+
+static std::chrono::system_clock::time_point toSystemClockTime(NSDate *date)
+{
+    ASSERT(date);
+    using namespace std::chrono;
+
+    return system_clock::time_point(duration_cast&lt;system_clock::duration&gt;(duration&lt;double&gt;(date.timeIntervalSince1970)));
+}
+
+void MediaPlayerPrivateAVFoundationObjC::clearMediaCache(const String&amp; path, std::chrono::system_clock::time_point modifiedSince)
+{
+    LOG(Media, &quot;MediaPlayerPrivateAVFoundationObjC::clearMediaCache()&quot;);
+    
+    AVAssetCache* assetCache = assetCacheForPath(path);
+    
+    for (NSString *key in [assetCache allKeys]) {
+        if (toSystemClockTime([assetCache lastModifiedDateOfEntryForKey:key]) &gt; modifiedSince)
+            [assetCache removeEntryForKey:key];
+    }
+
+    NSFileManager *fileManager = [NSFileManager defaultManager];
+    NSURL *baseURL = [assetCache URL];
+
+    if (modifiedSince &lt;= std::chrono::system_clock::time_point { }) {
+        [fileManager removeItemAtURL:baseURL error:nil];
+        return;
+    }
+    
+    NSArray *propertyKeys = @[NSURLNameKey, NSURLContentModificationDateKey, NSURLIsRegularFileKey];
+    NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtURL:baseURL includingPropertiesForKeys:
+        propertyKeys options:NSDirectoryEnumerationSkipsSubdirectoryDescendants
+        errorHandler:nil];
+    
+    RetainPtr&lt;NSMutableArray&gt; urlsToDelete = adoptNS([[NSMutableArray alloc] init]);
+    for (NSURL *fileURL : enumerator) {
+        NSDictionary *fileAttributes = [fileURL resourceValuesForKeys:propertyKeys error:nil];
+    
+        if (![fileAttributes[NSURLNameKey] hasPrefix:@&quot;CachedMedia-&quot;])
+            continue;
+        
+        if (![fileAttributes[NSURLIsRegularFileKey] boolValue])
+            continue;
+        
+        if (toSystemClockTime(fileAttributes[NSURLContentModificationDateKey]) &lt;= modifiedSince)
+            continue;
+        
+        [urlsToDelete addObject:fileURL];
+    }
+    
+    for (NSURL *fileURL in urlsToDelete.get())
+        [fileManager removeItemAtURL:fileURL error:nil];
+}
+
+void MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins(const String&amp; path, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp; origins)
+{
+    LOG(Media, &quot;MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins()&quot;);
+    AVAssetCache* assetCache = assetCacheForPath(path);
+    for (NSString *key in [assetCache allKeys]) {
+        URL keyAsURL = URL(URL(), key);
+        if (keyAsURL.isValid()) {
+            if (origins.contains(SecurityOrigin::create(keyAsURL)))
+                [assetCache removeEntryForKey:key];
+        }
+    }
+}
+
</ins><span class="cx"> MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC(MediaPlayer* player)
</span><span class="cx">     : MediaPlayerPrivateAVFoundation(player)
</span><span class="cx">     , m_weakPtrFactory(this)
</span><span class="lines">@@ -874,7 +965,11 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    [options setObject:[NSNumber numberWithBool:!player()-&gt;client().mediaPlayerShouldUsePersistentCache()] forKey:AVURLAssetUsesNoPersistentCacheKey];
</del><ins>+    bool usePersistentCache = player()-&gt;client().mediaPlayerShouldUsePersistentCache();
+    [options setObject:@(!usePersistentCache) forKey:AVURLAssetUsesNoPersistentCacheKey];
+    
+    if (usePersistentCache)
+        [options setObject:assetCacheForPath(player()-&gt;client().mediaPlayerMediaCacheDirectory()) forKey:AVURLAssetCacheKey];
</ins><span class="cx"> 
</span><span class="cx">     NSURL *cocoaURL = canonicalURL(url);
</span><span class="cx">     m_avAsset = adoptNS([allocAVURLAssetInstance() initWithURL:cocoaURL options:options.get()]);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -68,9 +68,9 @@
</span><span class="cx">     static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</span><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
</span><span class="cx"> 
</span><del>-    static void getSitesInMediaCache(Vector&lt;String&gt;&amp;);
-    static void clearMediaCache();
-    static void clearMediaCacheForSite(const String&amp;);
</del><ins>+    static HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; originsInMediaCache(const String&amp;);
+    static void clearMediaCache(const String&amp;, std::chrono::system_clock::time_point modifiedSince);
+    static void clearMediaCacheForOrigins(const String&amp;, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp;);
</ins><span class="cx">     static bool isAvailable();
</span><span class="cx"> 
</span><span class="cx">     PlatformMedia platformMedia() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (isAvailable())
</span><span class="cx">         registrar([](MediaPlayer* player) { return std::make_unique&lt;MediaPlayerPrivateQTKit&gt;(player); }, getSupportedTypes,
</span><del>-            supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, 0);
</del><ins>+            supportsType, originsInMediaCache, clearMediaCache, clearMediaCacheForOrigins, 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit(MediaPlayer* player)
</span><span class="lines">@@ -1339,23 +1339,30 @@
</span><span class="cx">     return QTKitLibrary();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateQTKit::getSitesInMediaCache(Vector&lt;String&gt;&amp; sites) 
</del><ins>+HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; MediaPlayerPrivateQTKit::originsInMediaCache(const String&amp;)
</ins><span class="cx"> {
</span><ins>+    HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; origins;
</ins><span class="cx">     NSArray *mediaSites = wkQTGetSitesInMediaDownloadCache();
</span><del>-    for (NSString *site in mediaSites)
-        sites.append(site);
</del><ins>+    
+    for (NSString *site in mediaSites) {
+        URL siteAsURL = URL(URL(), site);
+        if (siteAsURL.isValid())
+            origins.add(SecurityOrigin::create(siteAsURL));
+    }
+    return origins;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateQTKit::clearMediaCache()
</del><ins>+void MediaPlayerPrivateQTKit::clearMediaCache(const String&amp;, std::chrono::system_clock::time_point)
</ins><span class="cx"> {
</span><span class="cx">     LOG(Media, &quot;MediaPlayerPrivateQTKit::clearMediaCache()&quot;);
</span><span class="cx">     wkQTClearMediaDownloadCache();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateQTKit::clearMediaCacheForSite(const String&amp; site)
</del><ins>+void MediaPlayerPrivateQTKit::clearMediaCacheForOrigins(const String&amp;, const HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt;&amp; origins)
</ins><span class="cx"> {
</span><del>-    LOG(Media, &quot;MediaPlayerPrivateQTKit::clearMediaCacheForSite()&quot;);
-    wkQTClearMediaDownloadCacheForSite(site);
</del><ins>+    LOG(Media, &quot;MediaPlayerPrivateQTKit::clearMediaCacheForOrigins()&quot;);
+    for (auto&amp; origin : origins)
+        wkQTClearMediaDownloadCacheForSite(origin-&gt;toRawString());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayerPrivateQTKit::disableUnsupportedTracks()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacAVFoundationSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/mac/AVFoundationSPI.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/AVFoundationSPI.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebCore/platform/spi/mac/AVFoundationSPI.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -55,6 +55,21 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
</span><span class="cx"> 
</span><ins>+#if USE(APPLE_INTERNAL_SDK)
+#import &lt;AVFoundation/AVAssetCache_Private.h&gt;
+#else
+NS_ASSUME_NONNULL_BEGIN
+@interface AVAssetCache : NSObject
++ (AVAssetCache *)assetCacheWithURL:(NSURL *)URL;
+- (id)initWithURL:(NSURL *)URL;
+- (NSArray *)allKeys;
+- (NSDate *)lastModifiedDateOfEntryForKey:(NSString *)key;
+- (void)removeEntryForKey:(NSString *)key;
+@property (nonatomic, readonly, copy) NSURL *URL;
+@end
+NS_ASSUME_NONNULL_END
+#endif
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(AVKIT) &amp;&amp; USE(APPLE_INTERNAL_SDK)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2016-04-11  Jeremy Jones  &lt;jeremyj@apple.com&gt;
+
+        When clearing cache, also clear AVFoundation cache.
+        https://bugs.webkit.org/show_bug.cgi?id=155783
+        rdar://problem/25252541
+
+        Reviewed by Darin Adler.
+
+        Include the HTMLMediaElement media cache when doing disk cache operations.
+        Add a sandbox extension for media cache directory. This allows the UI process and the web process
+        to access the same cache.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode): Add media cache directory.
+        (WebKit::WebProcessCreationParameters::decode): Add media cache directory.
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/API/APIProcessPoolConfiguration.cpp:
+        (API::ProcessPoolConfiguration::createWithLegacyOptions):
+        (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add media cache directory.
+        (API::ProcessPoolConfiguration::copy): Add media cache directory.
+        * UIProcess/API/APIProcessPoolConfiguration.h:
+        * UIProcess/API/APIWebsiteDataStore.cpp:
+        (API::WebsiteDataStore::defaultMediaCacheDirectory): Default implementation.
+        * UIProcess/API/APIWebsiteDataStore.h:
+        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
+        (API::WebsiteDataStore::defaultMediaCacheDirectory): Media cache is in temporary directory.
+        (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): For resources in temporary directory.
+        (API::WebsiteDataStore::defaultDataStoreConfiguration): Init media cache directory.
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::legacyWebsiteDataStoreConfiguration): Add mediaCacheDirectory.
+        (WebKit::WebProcessPool::createNewWebProcess): Add mediaCacheDirectory.
+        * UIProcess/WebProcessPool.h:
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::WebsiteDataStore):
+        (WebKit::WebsiteDataStore::fetchData): Implement for mediaCacheDirectory.
+        (WebKit::WebsiteDataStore::removeData): Implement for mediaCacheDirectory.
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+        * UIProcess/efl/WebProcessPoolEfl.cpp:
+        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
+        * UIProcess/gtk/WebProcessPoolGtk.cpp:
+        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess): Initialize media cache directory.
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess): Consume sandbox extension.
+
</ins><span class="cx"> 2016-04-11  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r199315.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -65,6 +65,8 @@
</span><span class="cx">     encoder &lt;&lt; applicationCacheDirectoryExtensionHandle;
</span><span class="cx">     encoder &lt;&lt; webSQLDatabaseDirectory;
</span><span class="cx">     encoder &lt;&lt; webSQLDatabaseDirectoryExtensionHandle;
</span><ins>+    encoder &lt;&lt; mediaCacheDirectory;
+    encoder &lt;&lt; mediaCacheDirectoryExtensionHandle;
</ins><span class="cx"> #if ENABLE(SECCOMP_FILTERS)
</span><span class="cx">     encoder &lt;&lt; cookieStorageDirectory;
</span><span class="cx"> #endif
</span><span class="lines">@@ -159,6 +161,10 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(parameters.webSQLDatabaseDirectoryExtensionHandle))
</span><span class="cx">         return false;
</span><ins>+    if (!decoder.decode(parameters.mediaCacheDirectory))
+        return false;
+    if (!decoder.decode(parameters.mediaCacheDirectoryExtensionHandle))
+        return false;
</ins><span class="cx"> #if ENABLE(SECCOMP_FILTERS)
</span><span class="cx">     if (!decoder.decode(parameters.cookieStorageDirectory))
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -72,6 +72,8 @@
</span><span class="cx">     SandboxExtension::Handle applicationCacheDirectoryExtensionHandle;
</span><span class="cx">     String webSQLDatabaseDirectory;
</span><span class="cx">     SandboxExtension::Handle webSQLDatabaseDirectoryExtensionHandle;
</span><ins>+    String mediaCacheDirectory;
+    SandboxExtension::Handle mediaCacheDirectoryExtensionHandle;
</ins><span class="cx"> #if ENABLE(SECCOMP_FILTERS)
</span><span class="cx">     String cookieStorageDirectory;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> 
</span><span class="cx">     configuration-&gt;m_applicationCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory();
</span><span class="cx">     configuration-&gt;m_diskCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory();
</span><ins>+    configuration-&gt;m_mediaCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory();
</ins><span class="cx">     configuration-&gt;m_indexedDBDatabaseDirectory = WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory();
</span><span class="cx">     configuration-&gt;m_localStorageDirectory = WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory();
</span><span class="cx">     configuration-&gt;m_mediaKeysStorageDirectory = WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory();
</span><span class="lines">@@ -57,6 +58,7 @@
</span><span class="cx"> ProcessPoolConfiguration::ProcessPoolConfiguration()
</span><span class="cx">     : m_applicationCacheDirectory(WebsiteDataStore::defaultApplicationCacheDirectory())
</span><span class="cx">     , m_diskCacheDirectory(WebsiteDataStore::defaultNetworkCacheDirectory())
</span><ins>+    , m_mediaCacheDirectory(WebsiteDataStore::defaultMediaCacheDirectory())
</ins><span class="cx">     , m_indexedDBDatabaseDirectory(WebsiteDataStore::defaultIndexedDBDatabaseDirectory())
</span><span class="cx">     , m_localStorageDirectory(WebsiteDataStore::defaultLocalStorageDirectory())
</span><span class="cx">     , m_webSQLDatabaseDirectory(WebsiteDataStore::defaultWebSQLDatabaseDirectory())
</span><span class="lines">@@ -79,6 +81,7 @@
</span><span class="cx">     copy-&gt;m_diskCacheSizeOverride = this-&gt;m_diskCacheSizeOverride;
</span><span class="cx">     copy-&gt;m_applicationCacheDirectory = this-&gt;m_applicationCacheDirectory;
</span><span class="cx">     copy-&gt;m_diskCacheDirectory = this-&gt;m_diskCacheDirectory;
</span><ins>+    copy-&gt;m_mediaCacheDirectory = this-&gt;m_mediaCacheDirectory;
</ins><span class="cx">     copy-&gt;m_indexedDBDatabaseDirectory = this-&gt;m_indexedDBDatabaseDirectory;
</span><span class="cx">     copy-&gt;m_injectedBundlePath = this-&gt;m_injectedBundlePath;
</span><span class="cx">     copy-&gt;m_localStorageDirectory = this-&gt;m_localStorageDirectory;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -65,6 +65,9 @@
</span><span class="cx">     const WTF::String&amp; diskCacheDirectory() const { return m_diskCacheDirectory; }
</span><span class="cx">     void setDiskCacheDirectory(const WTF::String&amp; diskCacheDirectory) { m_diskCacheDirectory = diskCacheDirectory; }
</span><span class="cx"> 
</span><ins>+    const WTF::String&amp; mediaCacheDirectory() const { return m_mediaCacheDirectory; }
+    void setMediaCacheDirectory(const WTF::String&amp; mediaCacheDirectory) { m_mediaCacheDirectory = mediaCacheDirectory; }
+    
</ins><span class="cx">     const WTF::String&amp; indexedDBDatabaseDirectory() const { return m_indexedDBDatabaseDirectory; }
</span><span class="cx">     void setIndexedDBDatabaseDirectory(const WTF::String&amp; indexedDBDatabaseDirectory) { m_indexedDBDatabaseDirectory = indexedDBDatabaseDirectory; }
</span><span class="cx"> 
</span><span class="lines">@@ -102,6 +105,7 @@
</span><span class="cx"> 
</span><span class="cx">     WTF::String m_applicationCacheDirectory;
</span><span class="cx">     WTF::String m_diskCacheDirectory;
</span><ins>+    WTF::String m_mediaCacheDirectory;
</ins><span class="cx">     WTF::String m_indexedDBDatabaseDirectory;
</span><span class="cx">     WTF::String m_injectedBundlePath;
</span><span class="cx">     WTF::String m_localStorageDirectory;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -137,5 +137,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><ins>+    
+#if !PLATFORM(COCOA)
+String WebsiteDataStore::defaultMediaCacheDirectory()
+{
+    // FIXME: Implement. https://bugs.webkit.org/show_bug.cgi?id=156369 and https://bugs.webkit.org/show_bug.cgi?id=156370
+    return String();
+}
+#endif
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIWebsiteDataStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> 
</span><span class="cx">     static String defaultApplicationCacheDirectory();
</span><span class="cx">     static String defaultNetworkCacheDirectory();
</span><ins>+    static String defaultMediaCacheDirectory();
</ins><span class="cx"> 
</span><span class="cx">     static String defaultIndexedDBDatabaseDirectory();
</span><span class="cx">     static String defaultLocalStorageDirectory();
</span><span class="lines">@@ -60,6 +61,7 @@
</span><span class="cx">     WebsiteDataStore(WebKit::WebsiteDataStore::Configuration);
</span><span class="cx">     WebsiteDataStore();
</span><span class="cx"> 
</span><ins>+    static String tempDirectoryFileSystemRepresentation(const String&amp; directoryName);
</ins><span class="cx">     static String cacheDirectoryFileSystemRepresentation(const String&amp; directoryName);
</span><span class="cx">     static String websiteDataDirectoryFileSystemRepresentation(const String&amp; directoryName);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaAPIWebsiteDataStoreCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -57,6 +57,11 @@
</span><span class="cx">     return cacheDirectoryFileSystemRepresentation(&quot;NetworkCache&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String WebsiteDataStore::defaultMediaCacheDirectory()
+{
+    return tempDirectoryFileSystemRepresentation(&quot;MediaCache&quot;);
+}
+
</ins><span class="cx"> String WebsiteDataStore::defaultIndexedDBDatabaseDirectory()
</span><span class="cx"> {
</span><span class="cx">     return websiteDataDirectoryFileSystemRepresentation(&quot;IndexedDB&quot;);
</span><span class="lines">@@ -82,6 +87,33 @@
</span><span class="cx">     return websiteDataDirectoryFileSystemRepresentation(&quot;ResourceLoadStatistics&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String WebsiteDataStore::tempDirectoryFileSystemRepresentation(const String&amp; directoryName)
+{
+    static dispatch_once_t onceToken;
+    static NSURL *tempURL;
+    
+    dispatch_once(&amp;onceToken, ^{
+        NSURL *url = [NSURL fileURLWithPath:NSTemporaryDirectory()];
+        if (!url)
+            RELEASE_ASSERT_NOT_REACHED();
+        
+        if (!WebKit::processHasContainer()) {
+            NSString *bundleIdentifier = [NSBundle mainBundle].bundleIdentifier;
+            if (!bundleIdentifier)
+                bundleIdentifier = [NSProcessInfo processInfo].processName;
+            url = [url URLByAppendingPathComponent:bundleIdentifier isDirectory:YES];
+        }
+        
+        tempURL = [[url URLByAppendingPathComponent:@&quot;WebKit&quot; isDirectory:YES] retain];
+    });
+    
+    NSURL *url = [tempURL URLByAppendingPathComponent:directoryName isDirectory:YES];
+    if (![[NSFileManager defaultManager] createDirectoryAtURL:url withIntermediateDirectories:YES attributes:nil error:nullptr])
+        LOG_ERROR(&quot;Failed to create directory %@&quot;, url);
+    
+    return url.absoluteURL.path.fileSystemRepresentation;
+}
+
</ins><span class="cx"> String WebsiteDataStore::cacheDirectoryFileSystemRepresentation(const String&amp; directoryName)
</span><span class="cx"> {
</span><span class="cx">     static dispatch_once_t onceToken;
</span><span class="lines">@@ -144,6 +176,7 @@
</span><span class="cx"> 
</span><span class="cx">     configuration.applicationCacheDirectory = defaultApplicationCacheDirectory();
</span><span class="cx">     configuration.networkCacheDirectory = defaultNetworkCacheDirectory();
</span><ins>+    configuration.mediaCacheDirectory = defaultMediaCacheDirectory();
</ins><span class="cx"> 
</span><span class="cx">     configuration.webSQLDatabaseDirectory = defaultWebSQLDatabaseDirectory();
</span><span class="cx">     configuration.localStorageDirectory = defaultLocalStorageDirectory();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebProcessPoolCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx"> NSString *WebKitJSCJITEnabledDefaultsKey = @&quot;WebKitJSCJITEnabledDefaultsKey&quot;;
</span><span class="cx"> NSString *WebKitJSCFTLJITEnabledDefaultsKey = @&quot;WebKitJSCFTLJITEnabledDefaultsKey&quot;;
</span><span class="cx"> NSString *WebKitMediaKeysStorageDirectoryDefaultsKey = @&quot;WebKitMediaKeysStorageDirectory&quot;;
</span><ins>+NSString *WebKitMediaCacheDirectoryDefaultsKey = @&quot;WebKitMediaCacheDirectory&quot;;
</ins><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> static NSString *WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification = @&quot;NSApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification&quot;;
</span><span class="lines">@@ -336,6 +337,25 @@
</span><span class="cx">     return stringByResolvingSymlinksInPath([localStorageDirectory stringByStandardizingPath]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String WebProcessPool::legacyPlatformDefaultMediaCacheDirectory()
+{
+    registerUserDefaultsIfNeeded();
+    
+    NSString *mediaKeysCacheDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebKitMediaCacheDirectoryDefaultsKey];
+    if (!mediaKeysCacheDirectory || ![mediaKeysCacheDirectory isKindOfClass:[NSString class]]) {
+        mediaKeysCacheDirectory = NSTemporaryDirectory();
+        
+        if (!WebKit::processHasContainer()) {
+            NSString *bundleIdentifier = [NSBundle mainBundle].bundleIdentifier;
+            if (!bundleIdentifier)
+                bundleIdentifier = [NSProcessInfo processInfo].processName;
+            mediaKeysCacheDirectory = [mediaKeysCacheDirectory stringByAppendingPathComponent:bundleIdentifier];
+        }
+        mediaKeysCacheDirectory = [mediaKeysCacheDirectory stringByAppendingPathComponent:@&quot;WebKit/MediaCache&quot;];
+    }
+    return stringByResolvingSymlinksInPath([mediaKeysCacheDirectory stringByStandardizingPath]);
+}
+
</ins><span class="cx"> String WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory()
</span><span class="cx"> {
</span><span class="cx">     registerUserDefaultsIfNeeded();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx">     configuration.localStorageDirectory = processPoolConfiguration.localStorageDirectory();
</span><span class="cx">     configuration.webSQLDatabaseDirectory = processPoolConfiguration.webSQLDatabaseDirectory();
</span><span class="cx">     configuration.applicationCacheDirectory = processPoolConfiguration.applicationCacheDirectory();
</span><ins>+    configuration.mediaCacheDirectory = processPoolConfiguration.mediaCacheDirectory();
</ins><span class="cx">     configuration.mediaKeysStorageDirectory = processPoolConfiguration.mediaKeysStorageDirectory();
</span><span class="cx">     configuration.networkCacheDirectory = processPoolConfiguration.diskCacheDirectory();
</span><span class="cx"> 
</span><span class="lines">@@ -544,6 +545,10 @@
</span><span class="cx">     if (!parameters.webSQLDatabaseDirectory.isEmpty())
</span><span class="cx">         SandboxExtension::createHandleForReadWriteDirectory(parameters.webSQLDatabaseDirectory, parameters.webSQLDatabaseDirectoryExtensionHandle);
</span><span class="cx"> 
</span><ins>+    parameters.mediaCacheDirectory = m_configuration-&gt;mediaCacheDirectory();
+    if (!parameters.mediaCacheDirectory.isEmpty())
+        SandboxExtension::createHandleForReadWriteDirectory(parameters.mediaCacheDirectory, parameters.mediaCacheDirectoryExtensionHandle);
+    
</ins><span class="cx"> #if ENABLE(SECCOMP_FILTERS)
</span><span class="cx">     parameters.cookieStorageDirectory = this-&gt;cookieStorageDirectory();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -361,6 +361,7 @@
</span><span class="cx">     static String legacyPlatformDefaultIndexedDBDatabaseDirectory();
</span><span class="cx">     static String legacyPlatformDefaultWebSQLDatabaseDirectory();
</span><span class="cx">     static String legacyPlatformDefaultMediaKeysStorageDirectory();
</span><ins>+    static String legacyPlatformDefaultMediaCacheDirectory();
</ins><span class="cx">     static String legacyPlatformDefaultApplicationCacheDirectory();
</span><span class="cx">     static String legacyPlatformDefaultNetworkCacheDirectory();
</span><span class="cx">     static bool isNetworkCacheEnabled();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;WebsiteData.h&quot;
</span><span class="cx"> #include &lt;WebCore/ApplicationCacheStorage.h&gt;
</span><span class="cx"> #include &lt;WebCore/DatabaseTracker.h&gt;
</span><ins>+#include &lt;WebCore/HTMLMediaElement.h&gt;
</ins><span class="cx"> #include &lt;WebCore/OriginLock.h&gt;
</span><span class="cx"> #include &lt;WebCore/SecurityOrigin.h&gt;
</span><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="lines">@@ -77,6 +78,7 @@
</span><span class="cx">     , m_sessionID(WebCore::SessionID::defaultSessionID())
</span><span class="cx">     , m_networkCacheDirectory(WTFMove(configuration.networkCacheDirectory))
</span><span class="cx">     , m_applicationCacheDirectory(WTFMove(configuration.applicationCacheDirectory))
</span><ins>+    , m_mediaCacheDirectory(WTFMove(configuration.mediaCacheDirectory))
</ins><span class="cx">     , m_webSQLDatabaseDirectory(WTFMove(configuration.webSQLDatabaseDirectory))
</span><span class="cx">     , m_mediaKeysStorageDirectory(WTFMove(configuration.mediaKeysStorageDirectory))
</span><span class="cx">     , m_storageManager(StorageManager::create(WTFMove(configuration.localStorageDirectory)))
</span><span class="lines">@@ -255,6 +257,27 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CallbackAggregator&gt; callbackAggregator = adoptRef(new CallbackAggregator(fetchOptions, WTFMove(completionHandler)));
</span><span class="cx"> 
</span><ins>+    if (dataTypes.contains(WebsiteDataType::DiskCache)) {
+        StringCapture mediaCacheDirectory { m_mediaCacheDirectory };
+        
+        callbackAggregator-&gt;addPendingCallback();
+        m_queue-&gt;dispatch([fetchOptions, mediaCacheDirectory, callbackAggregator] {
+            HashSet&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt; origins = WebCore::HTMLMediaElement::originsInMediaCache(mediaCacheDirectory.string());
+            WebsiteData* websiteData = new WebsiteData;
+            
+            for (auto&amp; origin : origins) {
+                WebsiteData::Entry entry { origin, WebsiteDataType::DiskCache, 0 };
+                websiteData-&gt;entries.append(WTFMove(entry));
+            }
+            
+            WTF::RunLoop::main().dispatch([callbackAggregator, origins, websiteData] {
+                callbackAggregator-&gt;removePendingCallback(WTFMove(*websiteData));
+                
+                delete websiteData;
+            });
+        });
+    }
+
</ins><span class="cx">     auto networkProcessAccessType = computeNetworkProcessAccessTypeForDataFetch(dataTypes, !isPersistent());
</span><span class="cx">     if (networkProcessAccessType != ProcessAccessType::None) {
</span><span class="cx">         for (auto&amp; processPool : processPools()) {
</span><span class="lines">@@ -529,6 +552,19 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CallbackAggregator&gt; callbackAggregator = adoptRef(new CallbackAggregator(WTFMove(completionHandler)));
</span><span class="cx"> 
</span><ins>+    if (dataTypes.contains(WebsiteDataType::DiskCache)) {
+        StringCapture mediaCacheDirectory { m_mediaCacheDirectory };
+
+        callbackAggregator-&gt;addPendingCallback();
+        m_queue-&gt;dispatch([modifiedSince, mediaCacheDirectory, callbackAggregator] {
+            WebCore::HTMLMediaElement::clearMediaCache(mediaCacheDirectory.string(), modifiedSince);
+            
+            WTF::RunLoop::main().dispatch([callbackAggregator] {
+                callbackAggregator-&gt;removePendingCallback();
+            });
+        });
+    }
+
</ins><span class="cx">     auto networkProcessAccessType = computeNetworkProcessAccessTypeForDataRemoval(dataTypes, !isPersistent());
</span><span class="cx">     if (networkProcessAccessType != ProcessAccessType::None) {
</span><span class="cx">         for (auto&amp; processPool : processPools()) {
</span><span class="lines">@@ -755,7 +791,25 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CallbackAggregator&gt; callbackAggregator = adoptRef(new CallbackAggregator(WTFMove(completionHandler)));
</span><del>-
</del><ins>+    
+    if (dataTypes.contains(WebsiteDataType::DiskCache)) {
+        StringCapture mediaCacheDirectory { m_mediaCacheDirectory };
+        HashSet&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt; origins;
+        for (const auto&amp; dataRecord : dataRecords) {
+            for (const auto&amp; origin : dataRecord.origins)
+                origins.add(origin);
+        }
+        
+        callbackAggregator-&gt;addPendingCallback();
+        m_queue-&gt;dispatch([origins, mediaCacheDirectory, callbackAggregator] {
+            WebCore::HTMLMediaElement::clearMediaCacheForOrigins(mediaCacheDirectory.string(), origins);
+            
+            WTF::RunLoop::main().dispatch([callbackAggregator] {
+                callbackAggregator-&gt;removePendingCallback();
+            });
+        });
+    }
+    
</ins><span class="cx">     auto networkProcessAccessType = computeNetworkProcessAccessTypeForDataRemoval(dataTypes, !isPersistent());
</span><span class="cx">     if (networkProcessAccessType != ProcessAccessType::None) {
</span><span class="cx">         for (auto&amp; processPool : processPools()) {
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx">         String networkCacheDirectory;
</span><span class="cx">         String applicationCacheDirectory;
</span><span class="cx"> 
</span><ins>+        String mediaCacheDirectory;
</ins><span class="cx">         String webSQLDatabaseDirectory;
</span><span class="cx">         String localStorageDirectory;
</span><span class="cx">         String mediaKeysStorageDirectory;
</span><span class="lines">@@ -117,6 +118,7 @@
</span><span class="cx"> 
</span><span class="cx">     const String m_networkCacheDirectory;
</span><span class="cx">     const String m_applicationCacheDirectory;
</span><ins>+    const String m_mediaCacheDirectory;
</ins><span class="cx"> 
</span><span class="cx">     const String m_webSQLDatabaseDirectory;
</span><span class="cx">     const String m_mediaKeysStorageDirectory;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesseflWebProcessPoolEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -87,6 +87,11 @@
</span><span class="cx">     return API::WebsiteDataStore::defaultApplicationCacheDirectory();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String WebProcessPool::legacyPlatformDefaultMediaCacheDirectory()
+{
+    return API::WebsiteDataStore::defaultMediaCacheDirectory();
+}
+
</ins><span class="cx"> void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&amp; parameters)
</span><span class="cx"> {
</span><span class="cx">     initializeInspectorServer();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebProcessPoolGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -86,6 +86,11 @@
</span><span class="cx">     return API::WebsiteDataStore::defaultApplicationCacheDirectory();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WTF::String WebProcessPool::legacyPlatformDefaultMediaCacheDirectory()
+{
+    return API::WebsiteDataStore::defaultMediaCacheDirectory();
+}
+
</ins><span class="cx"> void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&amp; parameters)
</span><span class="cx"> {
</span><span class="cx">     initInspectorServer();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx"> #include &lt;WebCore/FrameLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/GCController.h&gt;
</span><span class="cx"> #include &lt;WebCore/GlyphPage.h&gt;
</span><ins>+#include &lt;WebCore/HTMLMediaElement.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IconDatabase.h&gt;
</span><span class="cx"> #include &lt;WebCore/JSDOMWindow.h&gt;
</span><span class="cx"> #include &lt;WebCore/Language.h&gt;
</span><span class="lines">@@ -293,6 +294,9 @@
</span><span class="cx">     if (!parameters.applicationCacheDirectory.isEmpty())
</span><span class="cx">         ApplicationCacheStorage::singleton().setCacheDirectory(parameters.applicationCacheDirectory);
</span><span class="cx"> 
</span><ins>+    if (!parameters.mediaCacheDirectory.isEmpty())
+        WebCore::HTMLMediaElement::setMediaCacheDirectory(parameters.mediaCacheDirectory);
+
</ins><span class="cx">     setCacheModel(static_cast&lt;uint32_t&gt;(parameters.cacheModel));
</span><span class="cx"> 
</span><span class="cx">     if (!parameters.languages.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (199325 => 199326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2016-04-12 00:48:12 UTC (rev 199325)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2016-04-12 01:00:07 UTC (rev 199326)
</span><span class="lines">@@ -135,6 +135,7 @@
</span><span class="cx">     SandboxExtension::consumePermanently(parameters.uiProcessBundleResourcePathExtensionHandle);
</span><span class="cx">     SandboxExtension::consumePermanently(parameters.webSQLDatabaseDirectoryExtensionHandle);
</span><span class="cx">     SandboxExtension::consumePermanently(parameters.applicationCacheDirectoryExtensionHandle);
</span><ins>+    SandboxExtension::consumePermanently(parameters.mediaCacheDirectoryExtensionHandle);
</ins><span class="cx">     SandboxExtension::consumePermanently(parameters.mediaKeyStorageDirectoryExtensionHandle);
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     SandboxExtension::consumePermanently(parameters.cookieStorageDirectoryExtensionHandle);
</span></span></pre>
</div>
</div>

</body>
</html>