Title: [228840] branches/safari-605-branch/Source/WebCore
- Revision
- 228840
- Author
- jmarc...@apple.com
- Date
- 2018-02-20 14:30:10 -0800 (Tue, 20 Feb 2018)
Log Message
Cherry-pick r228716. rdar://problem/37714038
Modified Paths
Diff
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (228839 => 228840)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-02-20 22:30:08 UTC (rev 228839)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-02-20 22:30:10 UTC (rev 228840)
@@ -1,5 +1,30 @@
2018-02-20 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r228716. rdar://problem/37714038
+
+ 2018-02-19 Chris Dumez <cdu...@apple.com>
+
+ 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-20 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r228708. rdar://problem/37714034
2018-02-19 Chris Dumez <cdu...@apple.com>
Modified: branches/safari-605-branch/Source/WebCore/platform/MIMETypeRegistry.cpp (228839 => 228840)
--- branches/safari-605-branch/Source/WebCore/platform/MIMETypeRegistry.cpp 2018-02-20 22:30:08 UTC (rev 228839)
+++ branches/safari-605-branch/Source/WebCore/platform/MIMETypeRegistry.cpp 2018-02-20 22:30:10 UTC (rev 228840)
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes