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

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

Issue 461233004: Fix crash in ServiceWorkerRegistrationHandle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add DCHECK Created 6 years, 4 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_registration_handle.cc
diff --git a/content/browser/service_worker/service_worker_registration_handle.cc b/content/browser/service_worker/service_worker_registration_handle.cc
index 7f005aff0fe7e443a3dc03a72f268d1541e6335e..3e333955b9c77bf4ed44bd6ae63ff4bd31333aaa 100644
--- a/content/browser/service_worker/service_worker_registration_handle.cc
+++ b/content/browser/service_worker/service_worker_registration_handle.cc
@@ -33,6 +33,7 @@ ServiceWorkerRegistrationHandle::ServiceWorkerRegistrationHandle(
}
ServiceWorkerRegistrationHandle::~ServiceWorkerRegistrationHandle() {
+ DCHECK(registration_);
registration_->RemoveListener(this);
}
@@ -60,8 +61,6 @@ void ServiceWorkerRegistrationHandle::OnRegistrationFailed(
ServiceWorkerRegistration* registration) {
DCHECK_EQ(registration->id(), registration_->id());
ClearVersionAttributes();
- registration_->RemoveListener(this);
- registration_ = NULL;
}
void ServiceWorkerRegistrationHandle::SetVersionAttributes(

Powered by Google App Engine
This is Rietveld 408576698