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

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

Issue 2056983004: [CacheStorage] Give ownership of all CacheStorageCaches to CacheStorage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 4 years, 6 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_browsertest.cc
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc
index ee5ecb3ad9bb9290af573807bc3ddbbf7adcb78d..baace99946ceea29dd01d83b4f30d0ea58beec7a 100644
--- a/content/browser/service_worker/service_worker_browsertest.cc
+++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -25,6 +25,7 @@
#include "build/build_config.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
#include "content/browser/cache_storage/cache_storage_cache.h"
+#include "content/browser/cache_storage/cache_storage_cache_handle.h"
#include "content/browser/cache_storage/cache_storage_context_impl.h"
#include "content/browser/cache_storage/cache_storage_manager.h"
#include "content/browser/service_worker/embedded_worker_instance.h"
@@ -1656,22 +1657,26 @@ class CacheStorageSideDataSizeChecker
this, result, continuation));
}
- void OnCacheStorageOpenCallback(int* result,
- const base::Closure& continuation,
- scoped_refptr<CacheStorageCache> cache,
- CacheStorageError error) {
+ void OnCacheStorageOpenCallback(
+ int* result,
+ const base::Closure& continuation,
+ std::unique_ptr<CacheStorageCacheHandle> cache_handle,
+ CacheStorageError error) {
ASSERT_EQ(CACHE_STORAGE_OK, error);
std::unique_ptr<ServiceWorkerFetchRequest> scoped_request(
new ServiceWorkerFetchRequest());
scoped_request->url = url_;
- cache->Match(std::move(scoped_request),
- base::Bind(&self::OnCacheStorageCacheMatchCallback, this,
- result, continuation));
+ CacheStorageCache* cache = cache_handle->value();
+ cache->Match(
+ std::move(scoped_request),
+ base::Bind(&self::OnCacheStorageCacheMatchCallback, this, result,
+ continuation, base::Passed(std::move(cache_handle))));
}
void OnCacheStorageCacheMatchCallback(
int* result,
const base::Closure& continuation,
+ std::unique_ptr<CacheStorageCacheHandle> cache_handle,
CacheStorageError error,
std::unique_ptr<ServiceWorkerResponse> response,
std::unique_ptr<storage::BlobDataHandle> blob_data_handle) {

Powered by Google App Engine
This is Rietveld 408576698