Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: content/browser/service_worker/service_worker_request_handler.cc

Issue 625433002: Pages controlled by ServiceWorkers should not participate in AppCaching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {
}
« no previous file with comments | « content/browser/service_worker/service_worker_request_handler.h ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698