Title: [265257] trunk/Source/WebCore
Revision
265257
Author
peng.l...@apple.com
Date
2020-08-04 13:45:17 -0700 (Tue, 04 Aug 2020)

Log Message

REGRESSION (r265019): ASSERTION FAILED: !m_impl || m_impl->wasConstructedOnMainThread() == isMainThread() under WebCore::PlaybackSessionInterfaceAVKit::invalidate()
https://bugs.webkit.org/show_bug.cgi?id=215118

Reviewed by Jer Noble.

Revert the change about using a WeakPtr of PlaybackSessionModel in r265019.
On WK1, a VideoFullscreenControllerContext (a subclass of PlaybackSessionModel)
object is created on the main thread, so we cannot use a WeakPtr of it on
the UI thread.

No new tests, fix an API test failure: WebKitLegacy.AudioSessionCategoryIOS.

* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (265256 => 265257)


--- trunk/Source/WebCore/ChangeLog	2020-08-04 19:26:58 UTC (rev 265256)
+++ trunk/Source/WebCore/ChangeLog	2020-08-04 20:45:17 UTC (rev 265257)
@@ -1,3 +1,22 @@
+2020-08-04  Peng Liu  <peng.l...@apple.com>
+
+        REGRESSION (r265019): ASSERTION FAILED: !m_impl || m_impl->wasConstructedOnMainThread() == isMainThread() under WebCore::PlaybackSessionInterfaceAVKit::invalidate()
+        https://bugs.webkit.org/show_bug.cgi?id=215118
+
+        Reviewed by Jer Noble.
+
+        Revert the change about using a WeakPtr of PlaybackSessionModel in r265019.
+        On WK1, a VideoFullscreenControllerContext (a subclass of PlaybackSessionModel)
+        object is created on the main thread, so we cannot use a WeakPtr of it on
+        the UI thread.
+
+        No new tests, fix an API test failure: WebKitLegacy.AudioSessionCategoryIOS.
+
+        * platform/ios/PlaybackSessionInterfaceAVKit.h:
+        * platform/ios/PlaybackSessionInterfaceAVKit.mm:
+        (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
+        (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
+
 2020-08-04  Chris Dumez  <cdu...@apple.com>
 
         Align AudioBufferSourceNode's start() / stop() with the specification

Modified: trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.h (265256 => 265257)


--- trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.h	2020-08-04 19:26:58 UTC (rev 265256)
+++ trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.h	2020-08-04 20:45:17 UTC (rev 265257)
@@ -81,7 +81,7 @@
 private:
     PlaybackSessionInterfaceAVKit(PlaybackSessionModel&);
     RetainPtr<WebAVPlayerController> m_playerController;
-    WeakPtr<PlaybackSessionModel> m_playbackSessionModel;
+    PlaybackSessionModel* m_playbackSessionModel { nullptr };
 };
 
 }

Modified: trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm (265256 => 265257)


--- trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm	2020-08-04 19:26:58 UTC (rev 265256)
+++ trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm	2020-08-04 20:45:17 UTC (rev 265257)
@@ -51,7 +51,7 @@
 
 PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit(PlaybackSessionModel& model)
     : m_playerController(adoptNS([[WebAVPlayerController alloc] init]))
-    , m_playbackSessionModel(makeWeakPtr(model))
+    , m_playbackSessionModel(&model)
 {
     ASSERT(isUIThread());
     model.addClient(*this);
@@ -81,7 +81,7 @@
 
 PlaybackSessionModel* PlaybackSessionInterfaceAVKit::playbackSessionModel() const
 {
-    return m_playbackSessionModel.get();
+    return m_playbackSessionModel;
 }
 
 void PlaybackSessionInterfaceAVKit::durationChanged(double duration)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to