Title: [175090] branches/safari-600.1.4.12-branch/Source/WebCore

Diff

Modified: branches/safari-600.1.4.12-branch/Source/WebCore/ChangeLog (175089 => 175090)


--- branches/safari-600.1.4.12-branch/Source/WebCore/ChangeLog	2014-10-23 06:54:06 UTC (rev 175089)
+++ branches/safari-600.1.4.12-branch/Source/WebCore/ChangeLog	2014-10-23 07:01:02 UTC (rev 175090)
@@ -1,5 +1,35 @@
 2014-10-22  Babak Shafiei  <[email protected]>
 
+        Merge r173974.
+
+    2014-09-25  Jeremy Jones  <[email protected]>
+
+            Race in ref pointer for WebVideoFullscreenInterfaceAVKit.
+            https://bugs.webkit.org/show_bug.cgi?id=137123
+
+            Reviewed by Eric Carlson.
+
+            Add WebThreadRun to prevent race with RefPtr of WebVideoFullscreenInterfaceAVKit.
+
+            * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+            (-[WebVideoFullscreenController didSetupFullscreen]): add WebThreadRun
+            * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+            (WebVideoFullscreenInterfaceAVKit::setDuration): ditto
+            (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto
+            (WebVideoFullscreenInterfaceAVKit::setRate): ditto
+            (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto
+            (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto
+            (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto
+            (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto
+            (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto
+            (WebVideoFullscreenInterfaceAVKit::setupFullscreen): ditto
+            (WebVideoFullscreenInterfaceAVKit::enterFullscreen): ditto
+            (WebVideoFullscreenInterfaceAVKit::exitFullscreen): ditto
+            (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): ditto
+            (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): ditto
+
+2014-10-22  Babak Shafiei  <[email protected]>
+
         Merge r173848.
 
     2014-09-22  Alexey Proskuryakov  <[email protected]>

Modified: branches/safari-600.1.4.12-branch/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (175089 => 175090)


--- branches/safari-600.1.4.12-branch/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm	2014-10-23 06:54:06 UTC (rev 175089)
+++ branches/safari-600.1.4.12-branch/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm	2014-10-23 07:01:02 UTC (rev 175090)
@@ -141,8 +141,10 @@
 
 - (void)didSetupFullscreen
 {
-    _model->setVideoFullscreenLayer(_videoFullscreenLayer.get());
-    _interface->enterFullscreen();
+    WebThreadRun(^{
+        _model->setVideoFullscreenLayer(_videoFullscreenLayer.get());
+        _interface->enterFullscreen();
+    });
 }
 
 - (void)didEnterFullscreen

Modified: branches/safari-600.1.4.12-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (175089 => 175090)


--- branches/safari-600.1.4.12-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2014-10-23 06:54:06 UTC (rev 175089)
+++ branches/safari-600.1.4.12-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2014-10-23 07:01:02 UTC (rev 175090)
@@ -607,7 +607,9 @@
         playerController.minTime = 0;
         playerController.status = AVPlayerControllerStatusReadyToPlay;
         
-        protect = nullptr;
+        WebThreadRun(^{
+            protect = nullptr;
+        });
     });
 }
 
@@ -621,7 +623,9 @@
             anchorTimeStamp:anchorTimeStamp rate:0];
         playerController().timing = timing;
         
-        protect = nullptr;
+        WebThreadRun(^{
+            protect = nullptr;
+        });
     });
 }
 
@@ -632,7 +636,9 @@
     dispatch_async(dispatch_get_main_queue(), ^{
         playerController().rate = isPlaying ? playbackRate : 0.;
         
-        protect = nullptr;
+        WebThreadRun(^{
+            protect = nullptr;
+        });
     });
 }
 
@@ -644,7 +650,9 @@
         playerController().hasEnabledVideo = hasVideo;
         playerController().contentDimensions = CGSizeMake(width, height);
         
-        protect = nullptr;
+        WebThreadRun(^{
+            protect = nullptr;
+        });
     });
 }
 
@@ -666,7 +674,9 @@
     dispatch_async(dispatch_get_main_queue(), ^{
         playerController().seekableTimeRanges = seekableRanges;
         
-        protect = nullptr;
+        WebThreadRun(^{
+            protect = nullptr;
+        });
     });
 }
 
@@ -696,7 +706,9 @@
         if (selectedIndex < webOptions.count)
             playerController().currentAudioMediaSelectionOption = webOptions[(size_t)selectedIndex];
         
-        protect = nullptr;
+        WebThreadRun(^{
+            protect = nullptr;
+        });
     });
 }
 
@@ -710,7 +722,9 @@
         if (selectedIndex < webOptions.count)
             playerController().currentLegibleMediaSelectionOption = webOptions[(size_t)selectedIndex];
         
-        protect = nullptr;
+        WebThreadRun(^{
+            protect = nullptr;
+        });
     });
 }
 
@@ -730,7 +744,9 @@
         playerController().externalPlaybackActive = enabled;
         [m_videoLayerContainer.get() setHidden:enabled];
         
-        protect = nullptr;
+        WebThreadRun(^{
+            protect = nullptr;
+        });
     });
 }
 
@@ -787,10 +803,12 @@
         [CATransaction commit];
 
         dispatch_async(dispatch_get_main_queue(), ^{
-            if (m_fullscreenChangeObserver)
-                m_fullscreenChangeObserver->didSetupFullscreen();
-            
-            protect = nullptr;
+            WebThreadRun(^{
+                if (m_fullscreenChangeObserver)
+                    m_fullscreenChangeObserver->didSetupFullscreen();
+
+                protect = nullptr;
+            });
         });
     });
 }
@@ -804,9 +822,13 @@
         [m_playerViewController enterFullScreenWithCompletionHandler:^(BOOL, NSError*)
         {
             [m_playerViewController setShowsPlaybackControls:YES];
-            if (m_fullscreenChangeObserver)
-                m_fullscreenChangeObserver->didEnterFullscreen();
-            protect = nullptr;
+
+            WebThreadRun(^{
+                if (m_fullscreenChangeObserver)
+                    m_fullscreenChangeObserver->didEnterFullscreen();
+
+                protect = nullptr;
+            });
         }];
     });
 }
@@ -830,9 +852,12 @@
         [m_playerViewController exitFullScreenWithCompletionHandler:^(BOOL, NSError*) {
             [m_videoLayerContainer setBackgroundColor:[[getUIColorClass() clearColor] CGColor]];
             [[m_playerViewController view] setBackgroundColor:[getUIColorClass() clearColor]];
-            if (m_fullscreenChangeObserver)
-                m_fullscreenChangeObserver->didExitFullscreen();
-            protect = nullptr;
+
+            WebThreadRun(^{
+                if (m_fullscreenChangeObserver)
+                    m_fullscreenChangeObserver->didExitFullscreen();
+                protect = nullptr;
+            });
         }];
     });
 }
@@ -872,9 +897,11 @@
         m_window = nil;
         m_parentView = nil;
         
-        if (m_fullscreenChangeObserver)
-            m_fullscreenChangeObserver->didCleanupFullscreen();
-        protect = nullptr;
+        WebThreadRun(^{
+            if (m_fullscreenChangeObserver)
+                m_fullscreenChangeObserver->didCleanupFullscreen();
+            protect = nullptr;
+        });
     });
 }
 
@@ -908,7 +935,9 @@
     dispatch_async(dispatch_get_main_queue(), ^{
         [m_window setHidden:YES];
         [m_playerViewController exitFullScreenAnimated:NO completionHandler:^(BOOL, NSError*) {
-            protect = nullptr;
+            WebThreadRun(^{
+                protect = nullptr;
+            });
         }];
     });
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to