Title: [291921] branches/safari-613-branch/Source/WebCore
Revision
291921
Author
[email protected]
Date
2022-03-25 18:51:39 -0700 (Fri, 25 Mar 2022)

Log Message

Cherry-pick r290837. rdar://problem/80407863

    [Cocoa] Crash in MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL
    https://bugs.webkit.org/show_bug.cgi?id=237456
    rdar://80407863

    Reviewed by Jer Noble.

    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
    (WebCore::MediaPlayerPrivateAVFoundation::enableInheritURIQueryComponent const): Create
    and use a static, never destroyed, AtomString instead of creating one every time
    a AVURLAsset is created. New method used by both AVF media players.
    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:

    * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
    (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Call enableInheritURIQueryComponent.
    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
    (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.

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

Modified Paths

Diff

Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (291920 => 291921)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-03-26 01:51:35 UTC (rev 291920)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-03-26 01:51:39 UTC (rev 291921)
@@ -1,5 +1,47 @@
 2022-03-23  Alan Coon  <[email protected]>
 
+        Cherry-pick r290837. rdar://problem/80407863
+
+    [Cocoa] Crash in MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL
+    https://bugs.webkit.org/show_bug.cgi?id=237456
+    rdar://80407863
+    
+    Reviewed by Jer Noble.
+    
+    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+    (WebCore::MediaPlayerPrivateAVFoundation::enableInheritURIQueryComponent const): Create
+    and use a static, never destroyed, AtomString instead of creating one every time
+    a AVURLAsset is created. New method used by both AVF media players.
+    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+    
+    * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+    (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Call enableInheritURIQueryComponent.
+    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-04  Eric Carlson  <[email protected]>
+
+            [Cocoa] Crash in MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL
+            https://bugs.webkit.org/show_bug.cgi?id=237456
+            rdar://80407863
+
+            Reviewed by Jer Noble.
+
+            * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+            (WebCore::MediaPlayerPrivateAVFoundation::enableInheritURIQueryComponent const): Create
+            and use a static, never destroyed, AtomString instead of creating one every time
+            a AVURLAsset is created. New method used by both AVF media players.
+            * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+
+            * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+            (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Call enableInheritURIQueryComponent.
+            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
+
+2022-03-23  Alan Coon  <[email protected]>
+
         Cherry-pick r290564. rdar://problem/89524668
 
     Force -webkit-user-modify used style to readonly for inert nodes

Modified: branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (291920 => 291921)


--- branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2022-03-26 01:51:35 UTC (rev 291920)
+++ branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2022-03-26 01:51:39 UTC (rev 291921)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -1085,6 +1085,12 @@
     return false;
 }
 
+bool MediaPlayerPrivateAVFoundation::shouldEnableInheritURIQueryComponent() const
+{
+    static NeverDestroyed<const AtomString> iTunesInheritsURIQueryComponent(MAKE_STATIC_STRING_IMPL("x-itunes-inherit-uri-query-component"));
+    return player()->doesHaveAttribute(iTunesInheritsURIQueryComponent);
+}
+
 void MediaPlayerPrivateAVFoundation::queueTaskOnEventLoop(Function<void()>&& task)
 {
     ASSERT(isMainThread());

Modified: branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (291920 => 291921)


--- branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2022-03-26 01:51:35 UTC (rev 291920)
+++ branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2022-03-26 01:51:39 UTC (rev 291921)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -329,6 +329,8 @@
     void setNeedsRenderingModeChanged();
     void renderingModeChanged();
 
+    bool shouldEnableInheritURIQueryComponent() const;
+
 private:
     MediaPlayer* m_player;
 

Modified: branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (291920 => 291921)


--- branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2022-03-26 01:51:35 UTC (rev 291920)
+++ branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2022-03-26 01:51:39 UTC (rev 291921)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -507,10 +507,8 @@
 
     setDelayCallbacks(true);
 
-    bool inheritURI = player()->doesHaveAttribute("x-itunes-inherit-uri-query-component");
-
     m_avfWrapper = new AVFWrapper(this);
-    m_avfWrapper->createAssetForURL(url, inheritURI);
+    m_avfWrapper->createAssetForURL(url, shouldEnableInheritURIQueryComponent());
     setDelayCallbacks(false);
     m_avfWrapper->checkPlayability();
 }

Modified: branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (291920 => 291921)


--- branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2022-03-26 01:51:35 UTC (rev 291920)
+++ branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2022-03-26 01:51:39 UTC (rev 291921)
@@ -884,8 +884,8 @@
     if ([headerFields count])
         [options setObject:headerFields.get() forKey:@"AVURLAssetHTTPHeaderFieldsKey"];
 
-    if (player()->doesHaveAttribute("x-itunes-inherit-uri-query-component"))
-        [options setObject:@YES forKey: AVURLAssetInheritURIQueryComponentFromReferencingURIKey];
+    if (shouldEnableInheritURIQueryComponent())
+        [options setObject:@YES forKey:AVURLAssetInheritURIQueryComponentFromReferencingURIKey];
 
     if (PAL::canLoad_AVFoundation_AVURLAssetUseClientURLLoadingExclusively())
         [options setObject:@YES forKey:AVURLAssetUseClientURLLoadingExclusively];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to