Index: content/browser/service_worker/service_worker_controllee_request_handler.cc |
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc |
index 74b8e80d8a86d5f4cf1aef2c98310a4d5af25cba..c6652dc92b1d01688564cd432b1ed9287b137c1d 100644 |
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc |
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc |
@@ -5,6 +5,7 @@ |
#include "content/browser/service_worker/service_worker_controllee_request_handler.h" |
#include <memory> |
+#include <set> |
#include <string> |
#include "base/trace_event/trace_event.h" |
@@ -213,6 +214,17 @@ ServiceWorkerControlleeRequestHandler::DidLookupRegistrationForMainResource( |
return; |
} |
+ if (!provider_host_->IsContextSecureForServiceWorker()) { |
+ // TODO(falken): Figure out a way to surface in the page's DevTools |
+ // console that the service worker was blocked for security. |
+ job_->FallbackToNetwork(); |
+ TRACE_EVENT_ASYNC_END1( |
+ "ServiceWorker", |
+ "ServiceWorkerControlleeRequestHandler::PrepareForMainResource", |
+ job_.get(), "Info", "Insecure context"); |
+ return; |
+ } |
+ |
if (need_to_update) { |
force_update_started_ = true; |
context_->UpdateServiceWorker( |