Title: [198566] trunk/Source/WebCore
Revision
198566
Author
jer.no...@apple.com
Date
2016-03-22 17:47:41 -0700 (Tue, 22 Mar 2016)

Log Message

CachedResource::MediaResource types shouldn't be blocked due to mixed-content.
https://bugs.webkit.org/show_bug.cgi?id=155588
<rdar://problem/25177795>

Reviewed by Brent Fulgham.

Follow-up to address crashes caused by r198549. Rather than destroy MediaResourceLoader on a background thread,
migrate the Ref to the main thread before releasing.

* platform/graphics/PlatformMediaResourceLoader.h:
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession dealloc]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (198565 => 198566)


--- trunk/Source/WebCore/ChangeLog	2016-03-23 00:19:47 UTC (rev 198565)
+++ trunk/Source/WebCore/ChangeLog	2016-03-23 00:47:41 UTC (rev 198566)
@@ -1,3 +1,18 @@
+2016-03-22  Jer Noble  <jer.no...@apple.com>
+
+        CachedResource::MediaResource types shouldn't be blocked due to mixed-content.
+        https://bugs.webkit.org/show_bug.cgi?id=155588
+        <rdar://problem/25177795>
+
+        Reviewed by Brent Fulgham.
+
+        Follow-up to address crashes caused by r198549. Rather than destroy MediaResourceLoader on a background thread,
+        migrate the Ref to the main thread before releasing.
+
+        * platform/graphics/PlatformMediaResourceLoader.h:
+        * platform/network/cocoa/WebCoreNSURLSession.mm:
+        (-[WebCoreNSURLSession dealloc]):
+
 2016-03-22  John Wilander  <wilan...@apple.com>
 
         Restrict WebSockets header parsing according to RFC6455 and RFC7230. Based on Lamarque V. Souza's original patch.

Modified: trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h (198565 => 198566)


--- trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h	2016-03-23 00:19:47 UTC (rev 198565)
+++ trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h	2016-03-23 00:47:41 UTC (rev 198566)
@@ -30,6 +30,7 @@
 
 #include <wtf/Noncopyable.h>
 #include <wtf/RefCounted.h>
+#include <wtf/ThreadSafeRefCounted.h>
 
 namespace WebCore {
 
@@ -55,7 +56,7 @@
 #endif
 };
 
-class PlatformMediaResourceLoader : public RefCounted<PlatformMediaResourceLoader> {
+class PlatformMediaResourceLoader : public ThreadSafeRefCounted<PlatformMediaResourceLoader> {
     WTF_MAKE_NONCOPYABLE(PlatformMediaResourceLoader); WTF_MAKE_FAST_ALLOCATED;
 public:
     enum LoadOption {

Modified: trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm (198565 => 198566)


--- trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2016-03-23 00:19:47 UTC (rev 198565)
+++ trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2016-03-23 00:47:41 UTC (rev 198566)
@@ -91,6 +91,12 @@
 {
     for (auto& task : _dataTasks)
         task.get().session = nil;
+
+    // FIXME(C++14): When we can move RefPtrs directly into blocks, replace this with a RefPtr&&:
+    WebCore::PlatformMediaResourceLoader* loader = _loader.leakRef();
+    callOnMainThread([loader] {
+        loader->deref();
+    });
     [super dealloc];
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to