| Index: Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| diff --git a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| index cbb117f1608a182fa1b5eb6f6cb283d14054f27d..6736b6d68e8882bf3f9a21e92ebebf9beee31a8b 100644
|
| --- a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| +++ b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| @@ -35,6 +35,7 @@
|
| #include "bindings/core/v8/ScriptState.h"
|
| #include "bindings/core/v8/SerializedScriptValue.h"
|
| #include "bindings/core/v8/SerializedScriptValueFactory.h"
|
| +#include "bindings/core/v8/V8ThrowException.h"
|
| #include "core/dom/DOMException.h"
|
| #include "core/dom/Document.h"
|
| #include "core/dom/ExceptionCode.h"
|
| @@ -246,6 +247,12 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(ScriptState* scriptS
|
| return promise;
|
| }
|
|
|
| + WebString webErrorMessage;
|
| + if (!m_provider->validateScopeAndScriptURL(patternURL, scriptURL, &webErrorMessage)) {
|
| + resolver->reject(V8ThrowException::createTypeError(scriptState->isolate(), webErrorMessage));
|
| + return promise;
|
| + }
|
| +
|
| m_provider->registerServiceWorker(patternURL, scriptURL, new RegistrationCallback(resolver));
|
|
|
| return promise;
|
|
|