Changeset 228931 in webkit


Ignore:
Timestamp:
Feb 22, 2018 1:40:38 PM (6 years ago)
Author:
Chris Dumez
Message:

ServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrationKey before passing it to the main thread
https://bugs.webkit.org/show_bug.cgi?id=183050
<rdar://problem/37796881>

Reviewed by Youenn Fablet.

Create an isolated copy of the registrationKey before passing it to the main thread in ServiceWorkerContainer's
startScriptFetchForJob() / jobFinishedLoadingScript() / jobFailedLoadingScript().

  • workers/service/ServiceWorkerContainer.cpp:

(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r228928 r228931  
     12018-02-22  Chris Dumez  <cdumez@apple.com>
     2
     3        ServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrationKey before passing it to the main thread
     4        https://bugs.webkit.org/show_bug.cgi?id=183050
     5        <rdar://problem/37796881>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Create an isolated copy of the registrationKey before passing it to the main thread in ServiceWorkerContainer's
     10        startScriptFetchForJob() / jobFinishedLoadingScript() / jobFailedLoadingScript().
     11
     12        * workers/service/ServiceWorkerContainer.cpp:
     13        (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
     14        (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
     15        (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
     16
    1172018-02-22  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp

    r228928 r228931  
    488488    if (!context) {
    489489        LOG_ERROR("ServiceWorkerContainer::jobResolvedWithRegistration called but the container's ScriptExecutionContext is gone");
    490         callOnMainThread([connection = m_swConnection, jobIdentifier = job.identifier(), registrationKey = job.data().registrationKey(), scriptURL = job.data().scriptURL.isolatedCopy()] {
     490        callOnMainThread([connection = m_swConnection, jobIdentifier = job.identifier(), registrationKey = job.data().registrationKey().isolatedCopy(), scriptURL = job.data().scriptURL.isolatedCopy()] {
    491491            connection->failedFetchingScript(jobIdentifier, registrationKey, { errorDomainWebKitInternal, 0, scriptURL, ASCIILiteral("Attempt to fetch service worker script with no ScriptExecutionContext") });
    492492        });
     
    506506    CONTAINER_RELEASE_LOG_IF_ALLOWED("jobFinishedLoadingScript: Successfuly finished fetching script for job %llu", job.identifier().toUInt64());
    507507
    508     callOnMainThread([connection = m_swConnection, jobDataIdentifier = job.data().identifier(), registrationKey = job.data().registrationKey(), script = script.isolatedCopy(), contentSecurityPolicy = contentSecurityPolicy.isolatedCopy()] {
     508    callOnMainThread([connection = m_swConnection, jobDataIdentifier = job.data().identifier(), registrationKey = job.data().registrationKey().isolatedCopy(), script = script.isolatedCopy(), contentSecurityPolicy = contentSecurityPolicy.isolatedCopy()] {
    509509        connection->finishFetchingScriptInServer({ jobDataIdentifier, registrationKey, script, contentSecurityPolicy, { } });
    510510    });
     
    523523        job.promise()->reject(*exception);
    524524
    525     callOnMainThread([connection = m_swConnection, jobIdentifier = job.identifier(), registrationKey = job.data().registrationKey(), error = error.isolatedCopy()] {
     525    callOnMainThread([connection = m_swConnection, jobIdentifier = job.identifier(), registrationKey = job.data().registrationKey().isolatedCopy(), error = error.isolatedCopy()] {
    526526        connection->failedFetchingScript(jobIdentifier, registrationKey, error);
    527527    });
Note: See TracChangeset for help on using the changeset viewer.