Title: [165844] branches/safari-537.75-branch/Source
- Revision
- 165844
- Author
- [email protected]
- Date
- 2014-03-18 14:22:48 -0700 (Tue, 18 Mar 2014)
Log Message
Merge r165478 and r165425.
Source/WebCore: Merge r165478.
2014-03-12 Jer Noble <[email protected]>
[Mac] Crash when running media/fallback.html test in MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification()
https://bugs.webkit.org/show_bug.cgi?id=130136
Reviewed by Eric Carlson.
MediaPlayerPrivateAVFoundation is trying to lock its m_queueMutex from an async thread after
while being destroyed in the main thread. To resolve this race condition, redispatch from
the async thread to the main thread, and use a WeakPtr to determine whether the object has
been destroyed or not.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
Source/WTF: Merge r165425.
2014-03-10 Jer Noble <[email protected]>
Improve WeakPtr operators.
https://bugs.webkit.org/show_bug.cgi?id=130053
Reviewed by Andreas Kling.
Replace the "operator!()" with an explicit bool operator. Add an "operator->()".
* wtf/WeakPtr.h:
(WTF::WeakPtr::operator bool):
(WTF::WeakPtr::operator->):
Modified Paths
Diff
Modified: branches/safari-537.75-branch/Source/WTF/ChangeLog (165843 => 165844)
--- branches/safari-537.75-branch/Source/WTF/ChangeLog 2014-03-18 20:58:38 UTC (rev 165843)
+++ branches/safari-537.75-branch/Source/WTF/ChangeLog 2014-03-18 21:22:48 UTC (rev 165844)
@@ -1,3 +1,20 @@
+2014-03-18 Jer Noble <[email protected]>
+
+ Merge r165425.
+
+ 2014-03-10 Jer Noble <[email protected]>
+
+ Improve WeakPtr operators.
+ https://bugs.webkit.org/show_bug.cgi?id=130053
+
+ Reviewed by Andreas Kling.
+
+ Replace the "operator!()" with an explicit bool operator. Add an "operator->()".
+
+ * wtf/WeakPtr.h:
+ (WTF::WeakPtr::operator bool):
+ (WTF::WeakPtr::operator->):
+
2014-03-07 Matthew Hanson <[email protected]>
Merge r164408.
Modified: branches/safari-537.75-branch/Source/WTF/wtf/WeakPtr.h (165843 => 165844)
--- branches/safari-537.75-branch/Source/WTF/wtf/WeakPtr.h 2014-03-18 20:58:38 UTC (rev 165843)
+++ branches/safari-537.75-branch/Source/WTF/wtf/WeakPtr.h 2014-03-18 21:22:48 UTC (rev 165844)
@@ -88,7 +88,10 @@
WeakPtr(PassRefPtr<WeakReference<T> > ref) : m_ref(ref) { }
T* get() const { return m_ref->get(); }
+ explicit operator bool() const { return m_ref->get(); }
+ T* operator->() const { return m_ref->get(); }
+
private:
RefPtr<WeakReference<T> > m_ref;
};
Modified: branches/safari-537.75-branch/Source/WebCore/ChangeLog (165843 => 165844)
--- branches/safari-537.75-branch/Source/WebCore/ChangeLog 2014-03-18 20:58:38 UTC (rev 165843)
+++ branches/safari-537.75-branch/Source/WebCore/ChangeLog 2014-03-18 21:22:48 UTC (rev 165844)
@@ -1,3 +1,22 @@
+2014-03-18 Jer Noble <[email protected]>
+
+ Merge r165478.
+
+ 2014-03-12 Jer Noble <[email protected]>
+
+ [Mac] Crash when running media/fallback.html test in MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification()
+ https://bugs.webkit.org/show_bug.cgi?id=130136
+
+ Reviewed by Eric Carlson.
+
+ MediaPlayerPrivateAVFoundation is trying to lock its m_queueMutex from an async thread after
+ while being destroyed in the main thread. To resolve this race condition, redispatch from
+ the async thread to the main thread, and use a WeakPtr to determine whether the object has
+ been destroyed or not.
+
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
+
2014-03-18 Matthew Hanson <[email protected]>
Follow-up fix for the merge of r163579.
Modified: branches/safari-537.75-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (165843 => 165844)
--- branches/safari-537.75-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h 2014-03-18 20:58:38 UTC (rev 165843)
+++ branches/safari-537.75-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h 2014-03-18 21:22:48 UTC (rev 165844)
@@ -30,6 +30,7 @@
#include "MediaPlayerPrivateAVFoundation.h"
#include <wtf/HashMap.h>
+#include <wtf/WeakPtr.h>
OBJC_CLASS AVAssetImageGenerator;
OBJC_CLASS AVAssetResourceLoadingRequest;
@@ -92,6 +93,8 @@
private:
MediaPlayerPrivateAVFoundationObjC(MediaPlayer*);
+ WeakPtr<MediaPlayerPrivateAVFoundationObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
+
// engine support
static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
static void getSupportedTypes(HashSet<String>& types);
@@ -182,6 +185,8 @@
void processLegacyClosedCaptionsTracks();
#endif
+ WeakPtrFactory<MediaPlayerPrivateAVFoundationObjC> m_weakPtrFactory;
+
RetainPtr<AVURLAsset> m_avAsset;
RetainPtr<AVPlayer> m_avPlayer;
RetainPtr<AVPlayerItem> m_avPlayerItem;
Modified: branches/safari-537.75-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (165843 => 165844)
--- branches/safari-537.75-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2014-03-18 20:58:38 UTC (rev 165843)
+++ branches/safari-537.75-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2014-03-18 21:22:48 UTC (rev 165844)
@@ -161,7 +161,6 @@
}
-(id)initWithCallback:(MediaPlayerPrivateAVFoundationObjC*)callback;
-(void)disconnect;
--(void)playableKnown;
-(void)metadataLoaded;
-(void)seekCompleted:(BOOL)finished;
-(void)didEnd:(NSNotification *)notification;
@@ -232,6 +231,7 @@
MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC(MediaPlayer* player)
: MediaPlayerPrivateAVFoundation(player)
+ , m_weakPtrFactory(this)
, m_objcObserver(adoptNS([[WebCoreAVFMovieObserver alloc] initWithCallback:this]))
, m_videoFrameHasDrawn(false)
, m_haveCheckedPlayability(false)
@@ -502,9 +502,13 @@
m_haveCheckedPlayability = true;
LOG(Media, "MediaPlayerPrivateAVFoundationObjC::checkPlayability(%p)", this);
+ auto weakThis = createWeakPtr();
[m_avAsset.get() loadValuesAsynchronouslyForKeys:[NSArray arrayWithObject:@"playable"] completionHandler:^{
- [m_objcObserver.get() playableKnown];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (weakThis)
+ weakThis->scheduleMainThreadNotification(MediaPlayerPrivateAVFoundation::Notification::AssetPlayabilityKnown);
+ });
}];
}
@@ -1590,14 +1594,6 @@
m_callback->scheduleMainThreadNotification(MediaPlayerPrivateAVFoundation::Notification::AssetMetadataLoaded);
}
-- (void)playableKnown
-{
- if (!m_callback)
- return;
-
- m_callback->scheduleMainThreadNotification(MediaPlayerPrivateAVFoundation::Notification::AssetPlayabilityKnown);
-}
-
- (void)seekCompleted:(BOOL)finished
{
if (!m_callback)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes