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

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

Issue 1704293002: ServiceWorker: Stop asynchronously creating response accessors to fix crash due to null context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win bots Created 4 years, 10 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 | « content/browser/service_worker/service_worker_cache_writer_unittest.cc ('k') | 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_write_to_cache_job.cc
diff --git a/content/browser/service_worker/service_worker_write_to_cache_job.cc b/content/browser/service_worker/service_worker_write_to_cache_job.cc
index b5477ab9a0195958a0be000ce5961f312dd8f918..4608c6fe4beb035e165faab5b6e5154b9729889c 100644
--- a/content/browser/service_worker/service_worker_write_to_cache_job.cc
+++ b/content/browser/service_worker/service_worker_write_to_cache_job.cc
@@ -97,13 +97,9 @@ void ServiceWorkerWriteToCacheJob::StartAsync() {
return;
}
- // These uses of Unretained are safe because this object is the sole owner of
- // |cache_writer_|, which in turn is the sole user of these callbacks.
cache_writer_.reset(new ServiceWorkerCacheWriter(
- base::Bind(&ServiceWorkerWriteToCacheJob::CreateCacheResponseReader,
- base::Unretained(this)),
- base::Bind(&ServiceWorkerWriteToCacheJob::CreateCacheResponseWriter,
- base::Unretained(this))));
+ CreateCacheResponseReader(), CreateCacheResponseReader(),
+ CreateCacheResponseWriter()));
version_->script_cache_map()->NotifyStartedCaching(url_, resource_id_);
did_notify_started_ = true;
StartNetRequest();
« no previous file with comments | « content/browser/service_worker/service_worker_cache_writer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698