Index: content/browser/service_worker/service_worker_version.cc |
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc |
index 53f05f35587fccc65f3b26b5fb4fadef4e6cd0c0..38057a4ccd57e912676e84be96705da7af06eb8a 100644 |
--- a/content/browser/service_worker/service_worker_version.cc |
+++ b/content/browser/service_worker/service_worker_version.cc |
@@ -392,8 +392,6 @@ void ServiceWorkerVersion::StartWorker( |
StartTimeoutTimer(); |
start_callbacks_.push_back(callback); |
if (running_status() == STOPPED) { |
- DCHECK(!cache_listener_.get()); |
- cache_listener_.reset(new ServiceWorkerCacheListener(this, context_)); |
embedded_worker_->Start( |
version_id_, scope_, script_url_, pause_after_download, |
base::Bind(&ServiceWorkerVersion::OnStartSentAndScriptEvaluated, |
@@ -814,7 +812,6 @@ void ServiceWorkerVersion::OnStarting() { |
void ServiceWorkerVersion::OnStarted() { |
DCHECK_EQ(RUNNING, running_status()); |
- DCHECK(cache_listener_.get()); |
RestartTick(&idle_time_); |
// Fire all start callbacks. |
@@ -875,18 +872,12 @@ void ServiceWorkerVersion::OnStopped( |
FOR_EACH_OBSERVER(Listener, listeners_, OnRunningStateChanged(this)); |
- // There should be no more communication from/to a stopped worker. Deleting |
- // the listener prevents any pending completion callbacks from causing |
- // messages to be sent to the stopped worker. |
- cache_listener_.reset(); |
- |
// Restart worker if we have any start callbacks and the worker isn't doomed. |
if (should_restart) { |
if (embedded_worker_->devtools_attached()) |
ClearTick(&start_time_); |
else |
RestartTick(&start_time_); |
- cache_listener_.reset(new ServiceWorkerCacheListener(this, context_)); |
embedded_worker_->Start( |
version_id_, scope_, script_url_, false /* pause_after_download */, |
base::Bind(&ServiceWorkerVersion::OnStartSentAndScriptEvaluated, |