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 55ae2e12519156135fd1f5f20d9e4a04b19071c5..3698eb7897c5fb61199ddb823efa5d35c8420af3 100644 |
--- a/content/browser/service_worker/service_worker_request_handler.cc |
+++ b/content/browser/service_worker/service_worker_request_handler.cc |
@@ -51,7 +51,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"; |
} |
@@ -71,7 +71,7 @@ void ServiceWorkerRequestHandler::InitializeHandler( |
RequestContextFrameType frame_type, |
scoped_refptr<ResourceRequestBody> body) { |
if (!request->url().SchemeIsHTTPOrHTTPS() || |
- !IsMethodSupportedForServiceWroker(request->method())) { |
+ !IsMethodSupportedForServiceWorker(request->method())) { |
return; |
} |
@@ -120,6 +120,15 @@ ServiceWorkerRequestHandler::CreateInterceptor( |
new ServiceWorkerRequestInterceptor(resource_context)); |
} |
+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() { |
} |