Index: content/browser/service_worker/service_worker_provider_host.cc |
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc |
index d823e2cee64e737b8eb9198a622f16b7447d3c1f..0208e546a54f29a084f735f365ad6ab798c62df9 100644 |
--- a/content/browser/service_worker/service_worker_provider_host.cc |
+++ b/content/browser/service_worker/service_worker_provider_host.cc |
@@ -119,7 +119,12 @@ int ServiceWorkerProviderHost::frame_id() const { |
} |
bool ServiceWorkerProviderHost::IsContextSecureForServiceWorker() const { |
- DCHECK(document_url_.is_valid()); |
+ // |document_url_| may be empty if loading has not begun, or |
+ // ServiceWorkerRequestHandler didn't handle the load (because e.g. another |
+ // handler did first, or the initial request URL was such that |
+ // OriginCanAccessServiceWorkers returned false). |
+ if (!document_url_.is_valid()) |
+ return false; |
if (!OriginCanAccessServiceWorkers(document_url_)) |
return false; |