Title: [277512] trunk/Source/WebCore
Revision
277512
Author
rn...@webkit.org
Date
2021-05-14 15:27:45 -0700 (Fri, 14 May 2021)

Log Message

Add ScriptDisallowedScope to MediaPlayerPrivateAVFoundation
https://bugs.webkit.org/show_bug.cgi?id=225797

Reviewed by Eric Carlson.

Deployed ScriptDisallowedScope to a bunch of functions in MediaPlayerPrivateAVFoundation.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
(-[WebCoreAVFMovieObserver metadataOutput:didOutputTimedMetadataGroups:fromPlayerItemTrack:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (277511 => 277512)


--- trunk/Source/WebCore/ChangeLog	2021-05-14 22:26:31 UTC (rev 277511)
+++ trunk/Source/WebCore/ChangeLog	2021-05-14 22:27:45 UTC (rev 277512)
@@ -1,3 +1,20 @@
+2021-05-14  Ryosuke Niwa  <rn...@webkit.org>
+
+        Add ScriptDisallowedScope to MediaPlayerPrivateAVFoundation
+        https://bugs.webkit.org/show_bug.cgi?id=225797
+
+        Reviewed by Eric Carlson.
+
+        Deployed ScriptDisallowedScope to a bunch of functions in MediaPlayerPrivateAVFoundation.
+
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
+        (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
+        (-[WebCoreAVFMovieObserver metadataOutput:didOutputTimedMetadataGroups:fromPlayerItemTrack:]):
+        (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
+
 2021-05-14  Jean-Yves Avenard  <j...@apple.com>
 
         Bad media session artwork URL results in blue "broken image" icon being shown in Now Playing

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (277511 => 277512)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2021-05-14 22:26:31 UTC (rev 277511)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2021-05-14 22:27:45 UTC (rev 277512)
@@ -38,6 +38,7 @@
 #include "Logging.h"
 #include "PlatformLayer.h"
 #include "PlatformTimeRanges.h"
+#include "ScriptDisallowedScope.h"
 #include "Settings.h"
 #include <CoreMedia/CoreMedia.h>
 #include <_javascript_Core/DataView.h>
@@ -477,6 +478,8 @@
     if (m_ignoreLoadStateChanges)
         return;
 
+    ScriptDisallowedScope::InMainThread scriptDisallowedScope;
+
     MediaPlayer::NetworkState newNetworkState = m_networkState;
     MediaPlayer::ReadyState newReadyState = m_readyState;
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (277511 => 277512)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-05-14 22:26:31 UTC (rev 277511)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-05-14 22:27:45 UTC (rev 277512)
@@ -53,6 +53,7 @@
 #import "PixelBufferConformerCV.h"
 #import "PlatformTimeRanges.h"
 #import "RuntimeApplicationChecks.h"
+#import "ScriptDisallowedScope.h"
 #import "SecurityOrigin.h"
 #import "SerializedPlatformDataCueMac.h"
 #import "SharedBuffer.h"
@@ -3604,6 +3605,9 @@
         m_taskQueue.enqueueTask([player = m_player, keyPath = WTFMove(keyPath), change = WTFMove(change), object = WTFMove(object), context] {
             if (!player)
                 return;
+
+            ScriptDisallowedScope::InMainThread scriptDisallowedScope;
+
             id newValue = [change valueForKey:NSKeyValueChangeNewKey];
             bool willChange = [[change valueForKey:NSKeyValueChangeNotificationIsPriorKey] boolValue];
             bool shouldLogValue = !willChange;
@@ -3700,6 +3704,9 @@
         m_taskQueue.enqueueTask([player = m_player, strings = WTFMove(strings), nativeSamples = WTFMove(nativeSamples), itemTime] {
             if (!player)
                 return;
+
+            ScriptDisallowedScope::InMainThread scriptDisallowedScope;
+
             MediaTime time = std::max(PAL::toMediaTime(itemTime), MediaTime::zeroTime());
             player->processCue(strings.get(), nativeSamples.get(), time);
         });
@@ -3731,6 +3738,8 @@
         if (!player)
             return;
 
+        ScriptDisallowedScope::InMainThread scriptDisallowedScope;
+
         for (AVTimedMetadataGroup *group in metadataGroups.get())
             player->metadataDidArrive(retainPtr(group.items), currentTime);
     });
@@ -3800,6 +3809,9 @@
     UNUSED_PARAM(resourceLoader);
     ensureOnMainThread([self, strongSelf = retainPtr(self), loadingRequest = retainPtr(loadingRequest)]() mutable {
         m_taskQueue.enqueueTask([player = m_player, loadingRequest = WTFMove(loadingRequest)] {
+
+            ScriptDisallowedScope::InMainThread scriptDisallowedScope;
+
             if (player)
                 player->didCancelLoadingRequest(loadingRequest.get());
         });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to