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

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

Issue 992353003: Decouple Cache Storage messaging from Service Worker/Embedded Worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused public stubs Created 5 years, 9 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_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,

Powered by Google App Engine
This is Rietveld 408576698