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

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

Issue 2570453002: Add CHECKs to investigate ServiceWorkerControlleeRequestHandler crash. (Closed)
Patch Set: fix compile 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 d1e82aac54e748d217663ddfb4987b3b756821ad..09fe5e8ffcf7d192752ef7d1cf5abf7053a58e89 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -82,7 +82,8 @@ ServiceWorkerProviderHost::ServiceWorkerProviderHost(
parent_frame_security_level_(parent_frame_security_level),
context_(context),
dispatcher_host_(dispatcher_host),
- allow_association_(true) {
+ allow_association_(true),
+ controller_was_deleted_(false) {
DCHECK_NE(SERVICE_WORKER_PROVIDER_UNKNOWN, provider_type_);
// PlzNavigate
@@ -174,6 +175,9 @@ 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_EQ(active_version->status(), ServiceWorkerVersion::ACTIVATING);
SetControllerVersionAttribute(active_version,
true /* notify_controllerchange */);
@@ -320,7 +324,9 @@ ServiceWorkerProviderHost::MatchRegistration() const {
return nullptr;
}
-void ServiceWorkerProviderHost::NotifyControllerLost() {
+void ServiceWorkerProviderHost::NotifyControllerLost(bool was_deleted) {
+ if (was_deleted)
+ controller_was_deleted_ = true;
SetControllerVersionAttribute(nullptr, true /* notify_controllerchange */);
}
@@ -411,7 +417,8 @@ void ServiceWorkerProviderHost::AddScopedProcessReferenceToPattern(
void ServiceWorkerProviderHost::ClaimedByRegistration(
ServiceWorkerRegistration* registration) {
- DCHECK(registration->active_version());
+ // TODO(falken): Change to DCHECK once https://crbug.com/655910 is resolved.
+ CHECK(registration->active_version());
if (registration == associated_registration_) {
SetControllerVersionAttribute(registration->active_version(),
true /* notify_controllerchange */);

Powered by Google App Engine
This is Rietveld 408576698