Title: [214554] trunk/Source/WebCore
Revision
214554
Author
[email protected]
Date
2017-03-29 12:25:22 -0700 (Wed, 29 Mar 2017)

Log Message

WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
https://bugs.webkit.org/show_bug.cgi?id=170129

Patch by Jeremy Jones <[email protected]> on 2017-03-29
Reviewed by David Kilzer.

No new tests becuase no new behavior.

Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::exitFullscreen):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (214553 => 214554)


--- trunk/Source/WebCore/ChangeLog	2017-03-29 19:23:32 UTC (rev 214553)
+++ trunk/Source/WebCore/ChangeLog	2017-03-29 19:25:22 UTC (rev 214554)
@@ -1,3 +1,19 @@
+2017-03-29  Jeremy Jones  <[email protected]>
+
+        WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
+        https://bugs.webkit.org/show_bug.cgi?id=170129
+
+        Reviewed by David Kilzer.
+
+        No new tests becuase no new behavior.
+
+        Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
+        Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.
+
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
+
 2017-03-29  Zan Dobersek  <[email protected]>
 
         [GCrypt] Add a Handle<> class to help with GCrypt object lifetime control

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (214553 => 214554)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h	2017-03-29 19:23:32 UTC (rev 214553)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h	2017-03-29 19:25:22 UTC (rev 214554)
@@ -66,7 +66,7 @@
     : public WebVideoFullscreenInterface
     , public WebVideoFullscreenModelClient
     , public WebPlaybackSessionModelClient
-    , public RefCounted<WebVideoFullscreenInterfaceAVKit> {
+    , public ThreadSafeRefCounted<WebVideoFullscreenInterfaceAVKit> {
 
 public:
     static Ref<WebVideoFullscreenInterfaceAVKit> create(WebPlaybackSessionInterfaceAVKit&);

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (214553 => 214554)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2017-03-29 19:23:32 UTC (rev 214553)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2017-03-29 19:25:22 UTC (rev 214554)
@@ -753,7 +753,7 @@
             [[m_playerViewController view] setBackgroundColor:[getUIColorClass() clearColor]];
             [CATransaction commit];
 
-            dispatch_async(dispatch_get_main_queue(), ^{
+            dispatch_async(dispatch_get_main_queue(), [protectedThis, this]() {
                 if (m_fullscreenChangeObserver)
                     m_fullscreenChangeObserver->didExitFullscreen();
             });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to