| Index: Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| diff --git a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| index 5bbf765d400c68d6259cd439aba44e8680e1c863..2a76172ff31b2bdeb3f840cfbfba94ef2bf349ff 100644
|
| --- a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| +++ b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| @@ -117,8 +117,6 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(ScriptState* scriptS
|
| return promise;
|
| }
|
|
|
| - // FIXME: This should use the container's execution context, not
|
| - // the callers.
|
| ExecutionContext* executionContext = scriptState->executionContext();
|
| RefPtr<SecurityOrigin> documentOrigin = executionContext->securityOrigin();
|
| String errorMessage;
|
| @@ -133,14 +131,14 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(ScriptState* scriptS
|
| return promise;
|
| }
|
|
|
| - KURL patternURL = executionContext->completeURL(options.scope());
|
| + KURL patternURL = callingExecutionContext(scriptState->isolate())->completeURL(options.scope());
|
| patternURL.removeFragmentIdentifier();
|
| if (!documentOrigin->canRequest(patternURL)) {
|
| resolver->reject(DOMException::create(SecurityError, "The scope must match the current origin."));
|
| return promise;
|
| }
|
|
|
| - KURL scriptURL = executionContext->completeURL(url);
|
| + KURL scriptURL = callingExecutionContext(scriptState->isolate())->completeURL(url);
|
| scriptURL.removeFragmentIdentifier();
|
| if (!documentOrigin->canRequest(scriptURL)) {
|
| resolver->reject(DOMException::create(SecurityError, "The origin of the script must match the current origin."));
|
| @@ -181,8 +179,6 @@ ScriptPromise ServiceWorkerContainer::getRegistration(ScriptState* scriptState,
|
| return promise;
|
| }
|
|
|
| - // FIXME: This should use the container's execution context, not
|
| - // the callers.
|
| ExecutionContext* executionContext = scriptState->executionContext();
|
| RefPtr<SecurityOrigin> documentOrigin = executionContext->securityOrigin();
|
| String errorMessage;
|
| @@ -197,7 +193,7 @@ ScriptPromise ServiceWorkerContainer::getRegistration(ScriptState* scriptState,
|
| return promise;
|
| }
|
|
|
| - KURL completedURL = executionContext->completeURL(documentURL);
|
| + KURL completedURL = callingExecutionContext(scriptState->isolate())->completeURL(documentURL);
|
| completedURL.removeFragmentIdentifier();
|
| if (!documentOrigin->canRequest(completedURL)) {
|
| resolver->reject(DOMException::create(SecurityError, "The documentURL must match the current origin."));
|
|
|