Title: [259011] branches/safari-610.1.7-branch/Source
Revision
259011
Author
alanc...@apple.com
Date
2020-03-25 14:30:43 -0700 (Wed, 25 Mar 2020)

Log Message

Cherry-pick r258795. rdar://problem/60886075

    Ensure media cache directory is created before passing to AVURLAsset.
    https://bugs.webkit.org/show_bug.cgi?id=209341

    Reviewed by Eric Carlson.

    Source/WebCore:

    Sandbox changes require the media cache directory to be created before passing to
    AVFoundation, to ensure that a sandbox extension is allowed to be created for that
    directory.

    When the mediaCacheDirectory is empty or null, no longer specify a temporary directory. This
    allows clients to disable caching by specifying an empty string for the cache directory.
    Since now assetCacheForPath() can return nil, update all the call sites to handle that
    possibility. Add a new method, ensureAssetCacheExistsAtPath() which tries to create a
    directory at the specified path, and returns nil if that is not possible. This ensures the
    cache path exists before adding the AVAssetCache to the AVURLAsset options dictionary.

    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
    (WebCore::assetCacheForPath):
    (WebCore::ensureAssetCacheExistsForPath):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):

    Source/WebKitLegacy/mac:

    MediaPlayerPrivateAVFoundaionObjC will no longer create an asset cache in a temporary
    directory by default; ensure that it's media cache directory is set during initialization.

    * WebView/WebView.mm:
    (-[WebView _commonInitializationWithFrameName:groupName:]):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258795 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610.1.7-branch/Source/WebCore/ChangeLog (259010 => 259011)


--- branches/safari-610.1.7-branch/Source/WebCore/ChangeLog	2020-03-25 21:27:07 UTC (rev 259010)
+++ branches/safari-610.1.7-branch/Source/WebCore/ChangeLog	2020-03-25 21:30:43 UTC (rev 259011)
@@ -1,79 +1,5 @@
-b"2020-03-24  Alan Coon  <alanc...@apple.com>\n\n        Cherry-pick r258476. rdar://problem/60839077\n\n    Add missing checks needed for AppBound Quirk\n    https://bugs.webkit.org/show_bug.cgi?id=209117\n    <rdar://problem/60460097>\n    \n    Reviewed by John Wilander.\n    \n    The checks for the 'NeedsInAppBrowserPrivacyQuirks' flag added in r258101 was incomplete.\n    Source/WebCore:\n    \n    Two additional call sites need to check the state of the flag.\n    \n    * bindings/js/ScriptController.cpp:\n    (WebCore::ScriptController::executeScriptInWorld): Add missing check for the quirk.\n    * loader/FrameLoaderClient.h: Add new API for the 'NeedsInAppBrowserPrivacyQuirks'\n    debug flag.\n    * page/Frame.cpp:\n    (WebCore::Frame::injectUserScriptImmediately): Ditto.\n    \n    Source/WebKit:\n    \n    These changes let the WebFrameLoaderClient report the quirk state to WebCore code.\n    \n    * WebProcess/WebCoreSupport/WebFrameLoaderC
 lient.cpp:\n    (WebKit::WebFrameLoaderClient::needsInAppBrowserPrivacyQuirks): Added.\n    * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:\n    * WebProcess/WebPage/WebPage.h:\n    (WebKit::WebPage::needsInAppBrowserPrivacyQuirks const): Added.\n    \n    \n    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258476 268f45cc-cd09-0410-ab3c-d52691b4dbfc\n\n    2020-03-14  Brent Fulgham  <bfulg...@apple.com>\n\n            Add missing checks needed for AppBound Quirk\n            https://bugs.webkit.org/show_bug.cgi?id=209117\n            <rdar://problem/60460097>\n\n            Reviewed by John Wilander.\n\n            The checks for the 'NeedsInAppBrowserPrivacyQuirks' flag added in r258101 was incomplete.\n            Two additional call sites need to check the state of the flag.\n\n            * bindings/js/ScriptController.cpp:\n            (WebCore::ScriptController::executeScriptInWorld): Add missing check for the quirk.\n            * loader/FrameLoa
 derClient.h: Add new API for the 'NeedsInAppBrowserPrivacyQuirks'\n            debug flag.\n            * page/Frame.cpp:\n            (WebCore::Frame::injectUserScriptImmediately): Ditto.\n\n"2020-03-17  Alan Coon  <alanc...@apple.com>
+b'2020-03-25  Alan Coon  <alanc...@apple.com>\n\n        Cherry-pick r258795. rdar://problem/60886075\n\n    Ensure media cache directory is created before passing to AVURLAsset.\n    https://bugs.webkit.org/show_bug.cgi?id=209341\n    \n    Reviewed by Eric Carlson.\n    \n    Source/WebCore:\n    \n    Sandbox changes require the media cache directory to be created before passing to\n    AVFoundation, to ensure that a sandbox extension is allowed to be created for that\n    directory.\n    \n    When the mediaCacheDirectory is empty or null, no longer specify a temporary directory. This\n    allows clients to disable caching by specifying an empty string for the cache directory.\n    Since now assetCacheForPath() can return nil, update all the call sites to handle that\n    possibility. Add a new method, ensureAssetCacheExistsAtPath() which tries to create a\n    directory at the specified path, and returns nil if that is not possible. This ensures the\n    cache 
 path exists before adding the AVAssetCache to the AVURLAsset options dictionary.\n    \n    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:\n    (WebCore::assetCacheForPath):\n    (WebCore::ensureAssetCacheExistsForPath):\n    (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache):\n    (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):\n    (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):\n    (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):\n    \n    Source/WebKitLegacy/mac:\n    \n    MediaPlayerPrivateAVFoundaionObjC will no longer create an asset cache in a temporary\n    directory by default; ensure that it\'s media cache directory is set during initialization.\n    \n    * WebView/WebView.mm:\n    (-[WebView _commonInitializationWithFrameName:groupName:]):\n    \n    \n    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258795 268f45cc-cd09-0410-ab3c-d52691b4dbfc\n\n 
    2020-03-20  Jer Noble  <jer.no...@apple.com>\n\n            Ensure media cache directory is created before passing to AVURLAsset.\n            https://bugs.webkit.org/show_bug.cgi?id=209341\n\n            Reviewed by Eric Carlson.\n\n            Sandbox changes require the media cache directory to be created before passing to\n            AVFoundation, to ensure that a sandbox extension is allowed to be created for that\n            directory.\n\n            When the mediaCacheDirectory is empty or null, no longer specify a temporary directory. This\n            allows clients to disable caching by specifying an empty string for the cache directory.\n            Since now assetCacheForPath() can return nil, update all the call sites to handle that\n            possibility. Add a new method, ensureAssetCacheExistsAtPath() which tries to create a\n            directory at the specified path, and returns nil if that is not possible. This ensures the\n            cache path exi
 sts before adding the AVAssetCache to the AVURLAsset options dictionary.\n\n            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:\n            (WebCore::assetCacheForPath):\n            (WebCore::ensureAssetCacheExistsForPath):\n            (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache):\n            (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):\n            (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):\n            (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):\n\n    b"2020-03-24  Alan Coon  <alanc...@apple.com>\\n\\n        Cherry-pick r258476. rdar://problem/60839077\\n\\n    Add missing checks needed for AppBound Quirk\\n    https://bugs.webkit.org/show_bug.cgi?id=209117\\n    <rdar://problem/60460097>\\n    \\n    Reviewed by John Wilander.\\n    \\n    The checks for the \'NeedsInAppBrowserPrivacyQuirks\' flag added in r258101 was incomple
 te.\\n    Source/WebCore:\\n    \\n    Two additional call sites need to check the state of the flag.\\n    \\n    * bindings/js/ScriptController.cpp:\\n    (WebCore::ScriptController::executeScriptInWorld): Add missing check for the quirk.\\n    * loader/FrameLoaderClient.h: Add new API for the \'NeedsInAppBrowserPrivacyQuirks\'\\n    debug flag.\\n    * page/Frame.cpp:\\n    (WebCore::Frame::injectUserScriptImmediately): Ditto.\\n    \\n    Source/WebKit:\\n    \\n    These changes let the WebFrameLoaderClient report the quirk state to WebCore code.\\n    \\n    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:\\n    (WebKit::WebFrameLoaderClient::needsInAppBrowserPrivacyQuirks): Added.\\n    * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:\\n    * WebProcess/WebPage/WebPage.h:\\n    (WebKit::WebPage::needsInAppBrowserPrivacyQuirks const): Added.\\n    \\n    \\n    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258476 268f45cc-cd09-0410-ab3c-d52691b4dbfc\\n\\n 
    2020-03-14  Brent Fulgham  <bfulg...@apple.com>\\n\\n            Add missing checks needed for AppBound Quirk\\n            https://bugs.webkit.org/show_bug.cgi?id=209117\\n            <rdar://problem/60460097>\\n\\n            Reviewed by John Wilander.\\n\\n            The checks for the \'NeedsInAppBrowserPrivacyQuirks\' flag added in r258101 was incomplete.\\n            Two additional call sites need to check the state of the flag.\\n\\n            * bindings/js/ScriptController.cpp:\\n            (WebCore::ScriptController::executeScriptInWorld): Add missing check for the quirk.\\n            * loader/FrameLoaderClient.h: Add new API for the \'NeedsInAppBrowserPrivacyQuirks\'\\n            debug flag.\\n            * page/Frame.cpp:\\n            (WebCore::Frame::injectUserScriptImmediately): Ditto.\\n\\n"2020-03-17  Alan Coon  <alanc...@apple.com>\n\n            Cherry-pick r258359. rdar://problem/60517387\n\n        [macOS] _AXSApplicationAccessibil
 ityEnabled should not be called\n        https://bugs.webkit.org/show_bug.cgi?id=208953\n\n        Reviewed by Brent Fulgham.\n\n        Source/WebCore:\n\n        The function _AXSApplicationAccessibilityEnabled and the notification kAXSApplicationAccessibilityEnabledNotification\n        exist on macOS, but they do not have the same behavior as on iOS, and should not be used in the same way. Using this\n        function and notification on macOS was introduced in <https://bugs.webkit.org/show_bug.cgi?id=208690>, and this patch\n        partially reverts this behavior.\n\n        API test: WebKit.IsRemoteUIAppForAccessibility\n\n        * testing/Internals.cpp:\n        (WebCore::Internals::isRemoteUIAppForAccessibility):\n        * testing/Internals.h:\n        * testing/Internals.idl:\n        * testing/Internals.mm:\n        (WebCore::Internals::isRemoteUIAppForAccessibility):\n\n        Source/WebCore/PAL:\n\n        Declare method to check if the process is a remote UI a
 pp for accessibility.\n\n        * pal/spi/cocoa/NSAccessibilitySPI.h:\n\n        Source/WebKit:\n\n        On macOS, stop using the function _AXSApplicationAccessibilityEnabled and listening to the notification\n        kAXSApplicationAccessibilityEnabledNotification, since they do not have the same behavior as on iOS.\n\n        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:\n        (WebKit::WebProcessPool::platformInitializeWebProcess):\n        (WebKit::WebProcessPool::registerNotificationObservers):\n        (WebKit::WebProcessPool::unregisterNotificationObservers):\n        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:\n        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):\n        * WebProcess/cocoa/WebProcessCocoa.mm:\n        (WebKit::WebProcess::platformInitializeProcess):\n        (WebKit::WebProcess::unblockAccessibilityServer):\n\n        Tools:\n\n        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:\n\n\n        git-svn-id: https://svn.webkit.org/
 repository/webkit/trunk@258359 268f45cc-cd09-0410-ab3c-d52691b4dbfc\n\n        2020-03-12  Per Arne Vollan  <pvol...@apple.com>\n\n                [macOS] _AXSApplicationAccessibilityEnabled should not be called\n                https://bugs.webkit.org/show_bug.cgi?id=208953\n\n                Reviewed by Brent Fulgham.\n\n                The function _AXSApplicationAccessibilityEnabled and the notification kAXSApplicationAccessibilityEnabledNotification\n                exist on macOS, but they do not have the same behavior as on iOS, and should not be used in the same way. Using this\n                function and notification on macOS was introduced in <https://bugs.webkit.org/show_bug.cgi?id=208690>, and this patch\n                partially reverts this behavior.\n\n                API test: WebKit.IsRemoteUIAppForAccessibility\n\n                * testing/Internals.cpp:\n                (WebCore::Internals::isRemoteUIAppForAccessibility):\n                * testing/
 Internals.h:\n                * testing/Internals.idl:\n                * testing/Internals.mm:\n                (WebCore::Internals::isRemoteUIAppForAccessibility):\n\n'2020-03-13  Kocsen Chung  <kocsen_ch...@apple.com>
 
-        Cherry-pick r258359. rdar://problem/60517387
-
-    [macOS] _AXSApplicationAccessibilityEnabled should not be called
-    https://bugs.webkit.org/show_bug.cgi?id=208953
-    
-    Reviewed by Brent Fulgham.
-    
-    Source/WebCore:
-    
-    The function _AXSApplicationAccessibilityEnabled and the notification kAXSApplicationAccessibilityEnabledNotification
-    exist on macOS, but they do not have the same behavior as on iOS, and should not be used in the same way. Using this
-    function and notification on macOS was introduced in <https://bugs.webkit.org/show_bug.cgi?id=208690>, and this patch
-    partially reverts this behavior.
-    
-    API test: WebKit.IsRemoteUIAppForAccessibility
-    
-    * testing/Internals.cpp:
-    (WebCore::Internals::isRemoteUIAppForAccessibility):
-    * testing/Internals.h:
-    * testing/Internals.idl:
-    * testing/Internals.mm:
-    (WebCore::Internals::isRemoteUIAppForAccessibility):
-    
-    Source/WebCore/PAL:
-    
-    Declare method to check if the process is a remote UI app for accessibility.
-    
-    * pal/spi/cocoa/NSAccessibilitySPI.h:
-    
-    Source/WebKit:
-    
-    On macOS, stop using the function _AXSApplicationAccessibilityEnabled and listening to the notification
-    kAXSApplicationAccessibilityEnabledNotification, since they do not have the same behavior as on iOS.
-    
-    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
-    (WebKit::WebProcessPool::platformInitializeWebProcess):
-    (WebKit::WebProcessPool::registerNotificationObservers):
-    (WebKit::WebProcessPool::unregisterNotificationObservers):
-    * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
-    (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
-    * WebProcess/cocoa/WebProcessCocoa.mm:
-    (WebKit::WebProcess::platformInitializeProcess):
-    (WebKit::WebProcess::unblockAccessibilityServer):
-    
-    Tools:
-    
-    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
-    
-    
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
-    2020-03-12  Per Arne Vollan  <pvol...@apple.com>
-
-            [macOS] _AXSApplicationAccessibilityEnabled should not be called
-            https://bugs.webkit.org/show_bug.cgi?id=208953
-
-            Reviewed by Brent Fulgham.
-
-            The function _AXSApplicationAccessibilityEnabled and the notification kAXSApplicationAccessibilityEnabledNotification
-            exist on macOS, but they do not have the same behavior as on iOS, and should not be used in the same way. Using this
-            function and notification on macOS was introduced in <https://bugs.webkit.org/show_bug.cgi?id=208690>, and this patch
-            partially reverts this behavior.
-
-            API test: WebKit.IsRemoteUIAppForAccessibility
-
-            * testing/Internals.cpp:
-            (WebCore::Internals::isRemoteUIAppForAccessibility):
-            * testing/Internals.h:
-            * testing/Internals.idl:
-            * testing/Internals.mm:
-            (WebCore::Internals::isRemoteUIAppForAccessibility):
-
-2020-03-13  Kocsen Chung  <kocsen_ch...@apple.com>
-
         Cherry-pick r258399. rdar://problem/60422524
 
     Crash in TextIterator::node via TextManipulationController::replace

Modified: branches/safari-610.1.7-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (259010 => 259011)


--- branches/safari-610.1.7-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2020-03-25 21:27:07 UTC (rev 259010)
+++ branches/safari-610.1.7-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2020-03-25 21:30:43 UTC (rev 259011)
@@ -79,6 +79,7 @@
 #import <pal/spi/cocoa/AVFoundationSPI.h>
 #import <pal/spi/cocoa/QuartzCoreSPI.h>
 #import <wtf/BlockObjCExceptions.h>
+#import <wtf/FileSystem.h>
 #import <wtf/ListHashSet.h>
 #import <wtf/NeverDestroyed.h>
 #import <wtf/OSObjectPtr.h>
@@ -323,20 +324,42 @@
 
 static AVAssetCache *assetCacheForPath(const String& path)
 {
-    NSURL *assetCacheURL;
-    
     if (path.isEmpty())
-        assetCacheURL = [[NSURL fileURLWithPath:NSTemporaryDirectory()] URLByAppendingPathComponent:@"MediaCache" isDirectory:YES];
-    else
-        assetCacheURL = [NSURL fileURLWithPath:path isDirectory:YES];
+        return nil;
 
-    return [PAL::getAVAssetCacheClass() assetCacheWithURL:assetCacheURL];
+    return [PAL::getAVAssetCacheClass() assetCacheWithURL:[NSURL fileURLWithPath:path isDirectory:YES]];
 }
 
+static AVAssetCache *ensureAssetCacheExistsForPath(const String& path)
+{
+    if (path.isEmpty())
+        return nil;
+
+    auto fileExistsAtPath = FileSystem::fileExists(path);
+
+    if (fileExistsAtPath && !FileSystem::fileIsDirectory(path, FileSystem::ShouldFollowSymbolicLinks::Yes)) {
+        // Non-directory file already exists at the path location; bail.
+        ASSERT_NOT_REACHED();
+        return nil;
+    }
+
+    if (!fileExistsAtPath && !FileSystem::makeAllDirectories(path)) {
+        // Could not create a directory at the specified location; bail.
+        ASSERT_NOT_REACHED();
+        return nil;
+    }
+
+    return assetCacheForPath(path);
+}
+
 HashSet<RefPtr<SecurityOrigin>> MediaPlayerPrivateAVFoundationObjC::originsInMediaCache(const String& path)
 {
     HashSet<RefPtr<SecurityOrigin>> origins;
-    for (NSString *key in [assetCacheForPath(path) allKeys]) {
+    AVAssetCache* assetCache = assetCacheForPath(path);
+    if (!assetCache)
+        return origins;
+
+    for (NSString *key in [assetCache allKeys]) {
         URL keyAsURL = URL(URL(), key);
         if (keyAsURL.isValid())
             origins.add(SecurityOrigin::create(keyAsURL));
@@ -353,6 +376,8 @@
 void MediaPlayerPrivateAVFoundationObjC::clearMediaCache(const String& path, WallTime modifiedSince)
 {
     AVAssetCache* assetCache = assetCacheForPath(path);
+    if (!assetCache)
+        return;
     
     for (NSString *key in [assetCache allKeys]) {
         if (toSystemClockTime([assetCache lastModifiedDateOfEntryForKey:key]) > modifiedSince)
@@ -395,6 +420,9 @@
 void MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins(const String& path, const HashSet<RefPtr<SecurityOrigin>>& origins)
 {
     AVAssetCache* assetCache = assetCacheForPath(path);
+    if (!assetCache)
+        return;
+
     for (NSString *key in [assetCache allKeys]) {
         URL keyAsURL = URL(URL(), key);
         if (keyAsURL.isValid()) {
@@ -840,8 +868,12 @@
     bool usePersistentCache = player()->shouldUsePersistentCache();
     [options setObject:@(!usePersistentCache) forKey:AVURLAssetUsesNoPersistentCacheKey];
     
-    if (usePersistentCache)
-        [options setObject:assetCacheForPath(player()->mediaCacheDirectory()) forKey:AVURLAssetCacheKey];
+    if (usePersistentCache) {
+        if (auto* assetCache = ensureAssetCacheExistsForPath(player()->mediaCacheDirectory()))
+            [options setObject:assetCache forKey:AVURLAssetCacheKey];
+        else
+            [options setObject:@NO forKey:AVURLAssetUsesNoPersistentCacheKey];
+    }
 
     NSURL *cocoaURL = canonicalURL(url);
     m_avAsset = adoptNS([PAL::allocAVURLAssetInstance() initWithURL:cocoaURL options:options.get()]);

Modified: branches/safari-610.1.7-branch/Source/WebKitLegacy/mac/ChangeLog (259010 => 259011)


--- branches/safari-610.1.7-branch/Source/WebKitLegacy/mac/ChangeLog	2020-03-25 21:27:07 UTC (rev 259010)
+++ branches/safari-610.1.7-branch/Source/WebKitLegacy/mac/ChangeLog	2020-03-25 21:30:43 UTC (rev 259011)
@@ -1,4 +1,4 @@
-2020-03-07  Brent Fulgham  <bfulg...@apple.com>
+b"2020-03-25  Alan Coon  <alanc...@apple.com>\n\n        Cherry-pick r258795. rdar://problem/60886075\n\n    Ensure media cache directory is created before passing to AVURLAsset.\n    https://bugs.webkit.org/show_bug.cgi?id=209341\n    \n    Reviewed by Eric Carlson.\n    \n    Source/WebCore:\n    \n    Sandbox changes require the media cache directory to be created before passing to\n    AVFoundation, to ensure that a sandbox extension is allowed to be created for that\n    directory.\n    \n    When the mediaCacheDirectory is empty or null, no longer specify a temporary directory. This\n    allows clients to disable caching by specifying an empty string for the cache directory.\n    Since now assetCacheForPath() can return nil, update all the call sites to handle that\n    possibility. Add a new method, ensureAssetCacheExistsAtPath() which tries to create a\n    directory at the specified path, and returns nil if that is not possible. This ensures the\n    c
 ache path exists before adding the AVAssetCache to the AVURLAsset options dictionary.\n    \n    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:\n    (WebCore::assetCacheForPath):\n    (WebCore::ensureAssetCacheExistsForPath):\n    (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache):\n    (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):\n    (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):\n    (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):\n    \n    Source/WebKitLegacy/mac:\n    \n    MediaPlayerPrivateAVFoundaionObjC will no longer create an asset cache in a temporary\n    directory by default; ensure that it's media cache directory is set during initialization.\n    \n    * WebView/WebView.mm:\n    (-[WebView _commonInitializationWithFrameName:groupName:]):\n    \n    \n    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258795 268f45cc-cd09-0410-ab3c-d52691b4dbfc\
 n\n    2020-03-20  Jer Noble  <jer.no...@apple.com>\n\n            Ensure media cache directory is created before passing to AVURLAsset.\n            https://bugs.webkit.org/show_bug.cgi?id=209341\n\n            Reviewed by Eric Carlson.\n\n            MediaPlayerPrivateAVFoundaionObjC will no longer create an asset cache in a temporary\n            directory by default; ensure that it's media cache directory is set during initialization.\n\n            * WebView/WebView.mm:\n            (-[WebView _commonInitializationWithFrameName:groupName:]):\n\n"2020-03-07  Brent Fulgham  <bfulg...@apple.com>
 
         Create a flag to disable in-app browser quirks
         https://bugs.webkit.org/show_bug.cgi?id=208777

Modified: branches/safari-610.1.7-branch/Source/WebKitLegacy/mac/WebView/WebView.mm (259010 => 259011)


--- branches/safari-610.1.7-branch/Source/WebKitLegacy/mac/WebView/WebView.mm	2020-03-25 21:27:07 UTC (rev 259010)
+++ branches/safari-610.1.7-branch/Source/WebKitLegacy/mac/WebView/WebView.mm	2020-03-25 21:30:43 UTC (rev 259011)
@@ -1427,6 +1427,10 @@
         if (WebCore::IOSApplication::isMobileSafari())
             WebCore::DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(true);
 #endif
+
+#if ENABLE(VIDEO)
+        WebCore::HTMLMediaElement::setMediaCacheDirectory(FileSystem::pathByAppendingComponent(NSTemporaryDirectory(), "MediaCache/"_s));
+#endif
         didOneTimeInitialization = true;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to