Chromium Code Reviews| Index: content/child/service_worker/web_service_worker_provider_impl.cc |
| diff --git a/content/child/service_worker/web_service_worker_provider_impl.cc b/content/child/service_worker/web_service_worker_provider_impl.cc |
| index 154dfe0281aae8a717387ef8bd2dd79bc7e73ee0..c50ceda114d90bf5d3feddea9beb1f1568cd4664 100644 |
| --- a/content/child/service_worker/web_service_worker_provider_impl.cc |
| +++ b/content/child/service_worker/web_service_worker_provider_impl.cc |
| @@ -9,6 +9,7 @@ |
| #include "content/child/service_worker/service_worker_provider_context.h" |
| #include "content/child/service_worker/web_service_worker_impl.h" |
| #include "content/child/thread_safe_sender.h" |
| +#include "content/common/service_worker/service_worker_utils.h" |
| #include "third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h" |
| #include "third_party/WebKit/public/platform/WebURL.h" |
| @@ -76,6 +77,19 @@ void WebServiceWorkerProviderImpl::getRegistrationForReady( |
| GetDispatcher()->GetRegistrationForReady(context_->provider_id(), callbacks); |
| } |
| +bool WebServiceWorkerProviderImpl::validateScopeAndScriptURL( |
| + const blink::WebURL& scope, |
| + const blink::WebURL& script_url, |
| + blink::WebString* error_message) { |
| + std::string error; |
| + bool has_error = ServiceWorkerUtils::ContainsDisallowedCharacter( |
| + scope, script_url, &error); |
| + if (has_error) |
| + *error_message = |
| + blink::WebString::fromUTF8(kServiceWorkerRegisterErrorPrefix + error); |
|
falken
2015/08/03 03:56:32
There's some discussion on the Blink patch about t
|
| + return !has_error; |
| +} |
| + |
| int WebServiceWorkerProviderImpl::provider_id() const { |
| return context_->provider_id(); |
| } |