Title: [228816] releases/WebKitGTK/webkit-2.20/Source/WebCore
Revision
228816
Author
[email protected]
Date
2018-02-20 05:49:04 -0800 (Tue, 20 Feb 2018)

Log Message

Merge r228716 - Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType()
https://bugs.webkit.org/show_bug.cgi?id=182927
<rdar://problem/37675748>

Reviewed by Antti Koivisto.

Make it safe to call MIMETypeRegistry::isSupportedJavaScriptMIMEType() from the non-main thread.
It is currently being called from a background thread in the following places:
- ServiceWorkerJob::didReceiveResponse()
- WorkerGlobalScope::importScripts()

These call sites on non-main threads were added recently with the support for service workers.

No new tests, already covered by existing tests that flakily experience service worker
process crashes.

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog (228815 => 228816)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog	2018-02-20 13:48:59 UTC (rev 228815)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog	2018-02-20 13:49:04 UTC (rev 228816)
@@ -1,3 +1,24 @@
+2018-02-19  Chris Dumez  <[email protected]>
+
+        Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType()
+        https://bugs.webkit.org/show_bug.cgi?id=182927
+        <rdar://problem/37675748>
+
+        Reviewed by Antti Koivisto.
+
+        Make it safe to call MIMETypeRegistry::isSupportedJavaScriptMIMEType() from the non-main thread.
+        It is currently being called from a background thread in the following places:
+        - ServiceWorkerJob::didReceiveResponse()
+        - WorkerGlobalScope::importScripts()
+
+        These call sites on non-main threads were added recently with the support for service workers.
+
+        No new tests, already covered by existing tests that flakily experience service worker
+        process crashes.
+
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
+
 2018-02-19  Dean Jackson  <[email protected]>
 
         SIGFPE @ int WebCore::SVGToOTFFontConverter::scaleUnitsPerEm<int> const + 45

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/platform/MIMETypeRegistry.cpp (228815 => 228816)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/platform/MIMETypeRegistry.cpp	2018-02-20 13:48:59 UTC (rev 228815)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/platform/MIMETypeRegistry.cpp	2018-02-20 13:49:04 UTC (rev 228816)
@@ -492,6 +492,15 @@
 {
     if (mimeType.isEmpty())
         return false;
+
+    if (!isMainThread()) {
+        bool isSupported = false;
+        callOnMainThreadAndWait([&isSupported, mimeType = mimeType.isolatedCopy()] {
+            isSupported = isSupportedJavaScriptMIMEType(mimeType);
+        });
+        return isSupported;
+    }
+
     if (!supportedJavaScriptMIMETypes)
         initializeSupportedNonImageMimeTypes();
     return supportedJavaScriptMIMETypes->contains(mimeType);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to