| Index: content/browser/service_worker/service_worker_request_handler.cc
|
| diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc
|
| index 300ea006321847ab76c7a3309d388f648ab8c9a7..2fff536d9fd4307089ac22d082ba665a7ba8d3b2 100644
|
| --- a/content/browser/service_worker/service_worker_request_handler.cc
|
| +++ b/content/browser/service_worker/service_worker_request_handler.cc
|
| @@ -47,7 +47,7 @@ class ServiceWorkerRequestInterceptor
|
| // This is work around to avoid hijacking CORS preflight.
|
| // TODO(horo): Remove this check when we implement "HTTP fetch" correctly.
|
| // http://fetch.spec.whatwg.org/#concept-http-fetch
|
| -bool IsMethodSupportedForServiceWroker(const std::string& method) {
|
| +bool IsMethodSupportedForServiceWorker(const std::string& method) {
|
| return method != "OPTIONS";
|
| }
|
|
|
| @@ -63,7 +63,7 @@ void ServiceWorkerRequestHandler::InitializeHandler(
|
| ResourceType resource_type,
|
| scoped_refptr<ResourceRequestBody> body) {
|
| if (!request->url().SchemeIsHTTPOrHTTPS() ||
|
| - !IsMethodSupportedForServiceWroker(request->method())) {
|
| + !IsMethodSupportedForServiceWorker(request->method())) {
|
| return;
|
| }
|
|
|
| @@ -104,6 +104,15 @@ ServiceWorkerRequestHandler::CreateInterceptor() {
|
| new ServiceWorkerRequestInterceptor);
|
| }
|
|
|
| +bool ServiceWorkerRequestHandler::IsControlledByServiceWorker(
|
| + net::URLRequest* request) {
|
| + ServiceWorkerRequestHandler* handler = GetHandler(request);
|
| + if (!handler || !handler->provider_host_)
|
| + return false;
|
| + return handler->provider_host_->associated_registration() ||
|
| + handler->provider_host_->running_hosted_version();
|
| +}
|
| +
|
| ServiceWorkerRequestHandler::~ServiceWorkerRequestHandler() {
|
| }
|
|
|
|
|