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..9815f0bd07edb2cba934766f4ea9a1411db43c33 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,18 @@ 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 = ""; |
|
nhiroki
2015/07/31 06:07:05
nit: you don't have to assign "" ("std::string err
|
| + bool has_error = ServiceWorkerUtils::ContainsDisallowedCharacter( |
| + scope, script_url, &error); |
| + if (has_error) |
| + *error_message = blink::WebString::fromUTF8(error); |
| + return !has_error; |
| +} |
| + |
| int WebServiceWorkerProviderImpl::provider_id() const { |
| return context_->provider_id(); |
| } |