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

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

Issue 658583006: [ServiceWorkerCache] Make ServiceWorkerCache::Put guarantee callback like the header says (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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.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.h
diff --git a/content/browser/service_worker/service_worker_cache.h b/content/browser/service_worker/service_worker_cache.h
index ee170e689d8c4a7a3b389b3f2739685930d77bab..867fb3f54543559db78ee748b4ac42c19d302bea 100644
--- a/content/browser/service_worker/service_worker_cache.h
+++ b/content/browser/service_worker/service_worker_cache.h
@@ -29,9 +29,6 @@ namespace content {
class ChromeBlobStorageContext;
class ServiceWorkerCacheMetadata;
-// TODO(jkarlin): Unload cache backend from memory once the cache object is no
-// longer referenced in javascript.
-
// Represents a ServiceWorker Cache as seen in
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html.
// InitializeIfNeeded must be called before calling the other public members.
@@ -103,7 +100,9 @@ class CONTENT_EXPORT ServiceWorkerCache
private:
friend class base::RefCounted<ServiceWorkerCache>;
+ class BlobReader;
struct KeysContext;
+ struct PutContext;
typedef std::vector<disk_cache::Entry*> Entries;
ServiceWorkerCache(
@@ -117,10 +116,16 @@ class CONTENT_EXPORT ServiceWorkerCache
// operations (those operations waiting for init to finish) won't.
virtual ~ServiceWorkerCache();
- void PutImpl(scoped_ptr<ServiceWorkerFetchRequest> request,
- scoped_ptr<ServiceWorkerResponse> response,
- scoped_ptr<storage::BlobDataHandle> blob_data_handle,
- const ResponseCallback& callback);
+ // Put callbacks.
+ static void PutImpl(scoped_ptr<PutContext> put_context);
+ static void PutDidCreateEntry(scoped_ptr<PutContext> put_context, int rv);
+ static void PutDidWriteHeaders(scoped_ptr<PutContext> put_context,
+ int expected_bytes,
+ int rv);
+ static void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context,
+ scoped_ptr<BlobReader> blob_reader,
+ disk_cache::ScopedEntryPtr entry,
+ bool success);
// Static callbacks for the Keys function.
static void KeysDidOpenNextEntry(scoped_ptr<KeysContext> keys_context,
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698