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

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

Issue 2604763002: Fix crash when forwarding a request to a null service worker. (Closed)
Patch Set: fix Created 4 years 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_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 92c46ff4e5ca31cb6b9996707ca21ca506f6a2c1..a32fdd32fea0d945eff3b333e822dd761e6becec 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -118,8 +118,7 @@ ServiceWorkerProviderHost::ServiceWorkerProviderHost(
parent_frame_security_level_(parent_frame_security_level),
context_(context),
dispatcher_host_(dispatcher_host),
- allow_association_(true),
- controller_was_deleted_(false) {
+ allow_association_(true) {
DCHECK_NE(SERVICE_WORKER_PROVIDER_UNKNOWN, provider_type_);
// PlzNavigate
@@ -211,9 +210,7 @@ void ServiceWorkerProviderHost::OnSkippedWaiting(
if (!controlling_version_)
return;
ServiceWorkerVersion* active_version = registration->active_version();
- // TODO(falken): Change to DCHECK once https://crbug.com/655910 is
- // resolved.
- CHECK(active_version);
+ DCHECK(active_version);
DCHECK_EQ(active_version->status(), ServiceWorkerVersion::ACTIVATING);
SetControllerVersionAttribute(active_version,
true /* notify_controllerchange */);
@@ -360,9 +357,7 @@ ServiceWorkerProviderHost::MatchRegistration() const {
return nullptr;
}
-void ServiceWorkerProviderHost::NotifyControllerLost(bool was_deleted) {
- if (was_deleted)
- controller_was_deleted_ = true;
+void ServiceWorkerProviderHost::NotifyControllerLost() {
SetControllerVersionAttribute(nullptr, true /* notify_controllerchange */);
}
@@ -472,8 +467,7 @@ void ServiceWorkerProviderHost::AddScopedProcessReferenceToPattern(
void ServiceWorkerProviderHost::ClaimedByRegistration(
ServiceWorkerRegistration* registration) {
- // TODO(falken): Change to DCHECK once https://crbug.com/655910 is resolved.
- CHECK(registration->active_version());
+ DCHECK(registration->active_version());
if (registration == associated_registration_) {
SetControllerVersionAttribute(registration->active_version(),
true /* notify_controllerchange */);

Powered by Google App Engine
This is Rietveld 408576698