Index: content/browser/cache_storage/cache_storage_cache.h |
diff --git a/content/browser/cache_storage/cache_storage_cache.h b/content/browser/cache_storage/cache_storage_cache.h |
index c558e2e3f5fc4b5a0e73bb1f1f364ff34474c273..89c857bfde268abef3198512a0d65fd0a1ca6457 100644 |
--- a/content/browser/cache_storage/cache_storage_cache.h |
+++ b/content/browser/cache_storage/cache_storage_cache.h |
@@ -74,17 +74,14 @@ class CONTENT_EXPORT CacheStorageCache |
void Match(scoped_ptr<ServiceWorkerFetchRequest> request, |
const ResponseCallback& callback); |
- // Puts the request and response object in the cache. The response body (if |
- // present) is stored in the cache, but not the request body. Returns |
- // ERROR_TYPE_OK on success. |
- void Put(scoped_ptr<ServiceWorkerFetchRequest> request, |
- scoped_ptr<ServiceWorkerResponse> response, |
- const ErrorCallback& callback); |
- |
- // Returns ErrorNotFound if not found. Otherwise deletes and returns |
- // ERROR_TYPE_OK. |
- void Delete(scoped_ptr<ServiceWorkerFetchRequest> request, |
- const ErrorCallback& callback); |
+ // Runs given batch operations. This corresponds to the Batch Cache Operations |
+ // algorithm in the spec. |
jkarlin
2015/05/08 12:04:25
Add a TODO and a corresponding crbug to make this
jkarlin
2015/05/08 15:27:27
Add a comment that operations can't be mixed. Desc
nhiroki
2015/05/11 07:35:04
Done.
nhiroki
2015/05/11 07:35:04
Done.
|
+ void BatchOperation(const std::vector<CacheStorageBatchOperation>& operations, |
+ const ErrorCallback& callback); |
+ void BatchDidOperation(const base::Closure& barrier_closure, |
jkarlin
2015/05/08 11:45:43
nit: Suggest BatchDidOneOperation. I hope to chang
nhiroki
2015/05/11 07:35:04
Done.
|
+ ErrorCallback* callback, |
+ ErrorType error); |
+ void BatchDidAllOperations(scoped_ptr<ErrorCallback> callback); |
// TODO(jkarlin): Have keys take an optional ServiceWorkerFetchRequest. |
// Returns ErrorTypeOK and a vector of requests if there are no errors. |
@@ -140,7 +137,11 @@ class CONTENT_EXPORT CacheStorageCache |
int rv); |
void MatchDoneWithBody(scoped_ptr<MatchContext> match_context); |
- // Put callbacks. |
+ // Puts the request and response object in the cache. The response body (if |
+ // present) is stored in the cache, but not the request body. Returns |
+ // ERROR_TYPE_OK on success. |
+ void Put(const CacheStorageBatchOperation& operation, |
+ const ErrorCallback& callback); |
void PutImpl(scoped_ptr<PutContext> put_context); |
void PutDidDelete(scoped_ptr<PutContext> put_context, ErrorType delete_error); |
void PutDidCreateEntry(scoped_ptr<PutContext> put_context, int rv); |
@@ -152,7 +153,10 @@ class CONTENT_EXPORT CacheStorageCache |
disk_cache::ScopedEntryPtr entry, |
bool success); |
- // Delete callbacks |
+ // Returns ErrorNotFound if not found. Otherwise deletes and returns |
+ // ERROR_TYPE_OK. |
+ void Delete(const CacheStorageBatchOperation& operation, |
+ const ErrorCallback& callback); |
void DeleteImpl(scoped_ptr<ServiceWorkerFetchRequest> request, |
const ErrorCallback& callback); |
void DeleteDidOpenEntry( |