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

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

Issue 2085923002: service worker: When claiming, don't assume document_url is valid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revise comment Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698