Chromium Code Reviews| Index: Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
| diff --git a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp |
| index cbb117f1608a182fa1b5eb6f6cb283d14054f27d..3b5699526c5fc7cc8a86349f6463e177cfb5e8ff 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 errorMessage; |
| + if (!m_provider->validateScopeAndScriptURL(patternURL, scriptURL, &errorMessage)) { |
| + resolver->reject(V8ThrowException::createTypeError(scriptState->isolate(), errorMessage)); |
|
nhiroki
2015/07/31 07:43:30
'"Failed to register a ServiceWorker: " + errorMes
|
| + return promise; |
| + } |
| + |
| m_provider->registerServiceWorker(patternURL, scriptURL, new RegistrationCallback(resolver)); |
| return promise; |