Title: [228708] trunk/Source/WebCore
Revision
228708
Author
cdu...@apple.com
Date
2018-02-19 13:03:39 -0800 (Mon, 19 Feb 2018)

Log Message

CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::TimerBase::~TimerBase
https://bugs.webkit.org/show_bug.cgi?id=182931
<rdar://problem/37602962>

Reviewed by Antti Koivisto.

Make sure PlatformMediaResource is ThreadSafeRefCounted since it is being
used from several threads in WebCoreNSURLSession. Also make sure it is
always destroyed on the main thread since it ends up destroying a
CachedRawResource object.

No new tests, no known reproduction case.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228707 => 228708)


--- trunk/Source/WebCore/ChangeLog	2018-02-19 20:56:41 UTC (rev 228707)
+++ trunk/Source/WebCore/ChangeLog	2018-02-19 21:03:39 UTC (rev 228708)
@@ -1,3 +1,22 @@
+2018-02-19  Chris Dumez  <cdu...@apple.com>
+
+        CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::TimerBase::~TimerBase
+        https://bugs.webkit.org/show_bug.cgi?id=182931
+        <rdar://problem/37602962>
+
+        Reviewed by Antti Koivisto.
+
+        Make sure PlatformMediaResource is ThreadSafeRefCounted since it is being
+        used from several threads in WebCoreNSURLSession. Also make sure it is
+        always destroyed on the main thread since it ends up destroying a
+        CachedRawResource object.
+
+        No new tests, no known reproduction case.
+
+        * platform/graphics/PlatformMediaResourceLoader.h:
+        * platform/network/cocoa/WebCoreNSURLSession.mm:
+        (-[WebCoreNSURLSessionDataTask dealloc]):
+
 2018-02-19  Zalan Bujtas  <za...@apple.com>
 
         [RenderTreeBuilder] Rename RenderTreeBuilder::removeAndDestroyChild() -> removeAndDestroy()

Modified: trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h (228707 => 228708)


--- trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h	2018-02-19 20:56:41 UTC (rev 228707)
+++ trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h	2018-02-19 21:03:39 UTC (rev 228708)
@@ -70,7 +70,7 @@
     PlatformMediaResourceLoader() = default;
 };
 
-class PlatformMediaResource : public RefCounted<PlatformMediaResource> {
+class PlatformMediaResource : public ThreadSafeRefCounted<PlatformMediaResource> {
     WTF_MAKE_NONCOPYABLE(PlatformMediaResource); WTF_MAKE_FAST_ALLOCATED;
 public:
     PlatformMediaResource() = default;

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


--- trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2018-02-19 20:56:41 UTC (rev 228707)
+++ trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2018-02-19 21:03:39 UTC (rev 228708)
@@ -539,6 +539,7 @@
     [_currentRequest release];
     [_error release];
     [_taskDescription release];
+    callOnMainThread([resource = WTFMove(_resource)] { });
     [super dealloc];
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to