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

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

Issue 1128163004: ServiceWorker: Add null check in ServiceWorkerContextWrapper::DeleteAndStartOver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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_context_wrapper.cc
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 7d20899a9decb634ea2dcd10ea442f4fabeecbb6..8df6f4297a8cf06b966b6ef26caca543ecf9b0a0 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -143,6 +143,13 @@ void ServiceWorkerContextWrapper::Shutdown() {
void ServiceWorkerContextWrapper::DeleteAndStartOver() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ if (!context_core_) {
+ // The context could be null due to system shutdown or restart failure. In
+ // either case, we should not have to recover the system, so just return
+ // here.
+ LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ return;
+ }
context_core_->DeleteAndStartOver(
base::Bind(&ServiceWorkerContextWrapper::DidDeleteAndStartOver, this));
}
« 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