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

Unified Diff: content/browser/service_worker/service_worker_cache_writer.h

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 | « no previous file | content/browser/service_worker/service_worker_cache_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_cache_writer.h
diff --git a/content/browser/service_worker/service_worker_cache_writer.h b/content/browser/service_worker/service_worker_cache_writer.h
index e4c38ccddfab8264d8e54f59b01c20ebde52305e..116eb58b3fbd949aa2b4d54d44aa51ae1bd98b5d 100644
--- a/content/browser/service_worker/service_worker_cache_writer.h
+++ b/content/browser/service_worker/service_worker_cache_writer.h
@@ -41,22 +41,13 @@ class CONTENT_EXPORT ServiceWorkerCacheWriter {
public:
using OnWriteCompleteCallback = base::Callback<void(net::Error)>;
- // The types for the factory functions passed into the constructor. These are
- // responsible for creating readers from the existing cache entry and writers
- // to the new cache entry when called. These are passed in as factories
- // instead of passing readers and writers in directly to avoid creating
- // writers to entries that won't be updated, and because this class may need
- // multiple readers internally.
- using ResponseReaderCreator =
- base::Callback<scoped_ptr<ServiceWorkerResponseReader>(void)>;
- using ResponseWriterCreator =
- base::Callback<scoped_ptr<ServiceWorkerResponseWriter>(void)>;
-
- // The existing reader may be null, in which case this instance will
+ // The |compare_reader| may be null, in which case this instance will
// unconditionally write back data supplied to |MaybeWriteHeaders| and
// |MaybeWriteData|.
- ServiceWorkerCacheWriter(const ResponseReaderCreator& reader_creator,
- const ResponseWriterCreator& writer_creator);
+ ServiceWorkerCacheWriter(
+ scoped_ptr<ServiceWorkerResponseReader> compare_reader,
+ scoped_ptr<ServiceWorkerResponseReader> copy_reader,
+ scoped_ptr<ServiceWorkerResponseWriter> writer);
~ServiceWorkerCacheWriter();
@@ -219,8 +210,6 @@ class CONTENT_EXPORT ServiceWorkerCacheWriter {
size_t compare_offset_;
- ResponseReaderCreator reader_creator_;
- ResponseWriterCreator writer_creator_;
scoped_ptr<ServiceWorkerResponseReader> compare_reader_;
scoped_ptr<ServiceWorkerResponseReader> copy_reader_;
scoped_ptr<ServiceWorkerResponseWriter> writer_;
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_cache_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698