Changeset 228716 in webkit


Ignore:
Timestamp:
Feb 19, 2018 4:20:53 PM (6 years ago)
Author:
Chris Dumez
Message:

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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r228715 r228716  
     12018-02-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType()
     4        https://bugs.webkit.org/show_bug.cgi?id=182927
     5        <rdar://problem/37675748>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Make it safe to call MIMETypeRegistry::isSupportedJavaScriptMIMEType() from the non-main thread.
     10        It is currently being called from a background thread in the following places:
     11        - ServiceWorkerJob::didReceiveResponse()
     12        - WorkerGlobalScope::importScripts()
     13
     14        These call sites on non-main threads were added recently with the support for service workers.
     15
     16        No new tests, already covered by existing tests that flakily experience service worker
     17        process crashes.
     18
     19        * platform/MIMETypeRegistry.cpp:
     20        (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
     21
    1222018-02-19  Dean Jackson  <dino@apple.com>
    223
  • trunk/Source/WebCore/platform/MIMETypeRegistry.cpp

    r227631 r228716  
    493493    if (mimeType.isEmpty())
    494494        return false;
     495
     496    if (!isMainThread()) {
     497        bool isSupported = false;
     498        callOnMainThreadAndWait([&isSupported, mimeType = mimeType.isolatedCopy()] {
     499            isSupported = isSupportedJavaScriptMIMEType(mimeType);
     500        });
     501        return isSupported;
     502    }
     503
    495504    if (!supportedJavaScriptMIMETypes)
    496505        initializeSupportedNonImageMimeTypes();
Note: See TracChangeset for help on using the changeset viewer.