Title: [156315] trunk/Source/WebCore
- Revision
- 156315
- Author
- [email protected]
- Date
- 2013-09-23 18:56:02 -0700 (Mon, 23 Sep 2013)
Log Message
[Windows] Moving back in history from a page with <video>, then moving forward causes crash.
https://bugs.webkit.org/show_bug.cgi?id=120475
Reviewed by Anders Carlsson.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::AVFWrapper): Add assertion that creation is on main thread.
(WebCore::AVFWrapper::~AVFWrapper): Add assertion that destruction is on main thread.
(WebCore::destroyAVFWrapper): Helper function to dispatch on main queue.
(WebCore::AVFWrapper::disconnectAndDeleteAVFWrapper): Spawn AVFoundationCF destruction to
main queue.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (156314 => 156315)
--- trunk/Source/WebCore/ChangeLog 2013-09-24 01:44:10 UTC (rev 156314)
+++ trunk/Source/WebCore/ChangeLog 2013-09-24 01:56:02 UTC (rev 156315)
@@ -1,3 +1,17 @@
+2013-09-23 Brent Fulgham <[email protected]>
+
+ [Windows] Moving back in history from a page with <video>, then moving forward causes crash.
+ https://bugs.webkit.org/show_bug.cgi?id=120475
+
+ Reviewed by Anders Carlsson.
+
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::AVFWrapper::AVFWrapper): Add assertion that creation is on main thread.
+ (WebCore::AVFWrapper::~AVFWrapper): Add assertion that destruction is on main thread.
+ (WebCore::destroyAVFWrapper): Helper function to dispatch on main queue.
+ (WebCore::AVFWrapper::disconnectAndDeleteAVFWrapper): Spawn AVFoundationCF destruction to
+ main queue.
+
2013-09-23 Andreas Kling <[email protected]>
RenderTextControlSingleLine::updateFromElement() override not needed.
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (156314 => 156315)
--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2013-09-24 01:44:10 UTC (rev 156314)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2013-09-24 01:56:02 UTC (rev 156315)
@@ -1161,6 +1161,7 @@
, m_objectID(s_nextAVFWrapperObjectID++)
, m_currentTrack(0)
{
+ ASSERT(isMainThread());
LOG(Media, "AVFWrapper::AVFWrapper(%p)", this);
m_notificationQueue = dispatch_queue_create("MediaPlayerPrivateAVFoundationCF.notificationQueue", 0);
@@ -1169,6 +1170,7 @@
AVFWrapper::~AVFWrapper()
{
+ ASSERT(isMainThread());
LOG(Media, "AVFWrapper::~AVFWrapper(%p %d)", this, m_objectID);
destroyVideoLayer();
@@ -1247,6 +1249,15 @@
dispatch_async_f(dispatchQueue(), this, disconnectAndDeleteAVFWrapper);
}
+static void destroyAVFWrapper(void* context)
+{
+ AVFWrapper* avfWrapper = static_cast<AVFWrapper*>(context);
+ if (!avfWrapper)
+ return;
+
+ delete avfWrapper;
+}
+
void AVFWrapper::disconnectAndDeleteAVFWrapper(void* context)
{
AVFWrapper* avfWrapper = static_cast<AVFWrapper*>(context);
@@ -1279,7 +1290,8 @@
AVCFPlayerItemRemoveOutput(avfWrapper->avPlayerItem(), avfWrapper->legibleOutput());
#endif
- delete avfWrapper;
+ // We must release the AVCFPlayer and other items on the same thread that created them.
+ dispatch_async_f(dispatch_get_main_queue(), context, destroyAVFWrapper);
}
void AVFWrapper::createAssetForURL(const String& url)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes