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

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

Issue 539673003: Service Workers: Allow empty string as cache name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sw-gavin
Patch Set: Update test, remove unused enum value Created 6 years, 3 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_cache_storage.cc
diff --git a/content/browser/service_worker/service_worker_cache_storage.cc b/content/browser/service_worker/service_worker_cache_storage.cc
index 5409289e81f73ba5d825b5e45f869a28d2c24ab5..23d4e1d6c40af9f54d2ad34d2bfdb3476739be24 100644
--- a/content/browser/service_worker/service_worker_cache_storage.cc
+++ b/content/browser/service_worker/service_worker_cache_storage.cc
@@ -405,11 +405,6 @@ void ServiceWorkerCacheStorage::CreateCache(
return;
}
- if (cache_name.empty()) {
- callback.Run(kInvalidCacheID, CACHE_STORAGE_ERROR_EMPTY_KEY);
- return;
- }
-
if (GetLoadedCache(cache_name)) {
callback.Run(kInvalidCacheID, CACHE_STORAGE_ERROR_EXISTS);
return;
@@ -436,11 +431,6 @@ void ServiceWorkerCacheStorage::GetCache(
return;
}
- if (cache_name.empty()) {
- callback.Run(kInvalidCacheID, CACHE_STORAGE_ERROR_EMPTY_KEY);
- return;
- }
-
CacheContext* cache_context = GetLoadedCache(cache_name);
if (!cache_context) {
callback.Run(kInvalidCacheID, CACHE_STORAGE_ERROR_NOT_FOUND);
@@ -471,11 +461,6 @@ void ServiceWorkerCacheStorage::HasCache(const std::string& cache_name,
return;
}
- if (cache_name.empty()) {
- callback.Run(false, CACHE_STORAGE_ERROR_EMPTY_KEY);
- return;
- }
-
bool has_cache = GetLoadedCache(cache_name) != NULL;
callback.Run(has_cache, CACHE_STORAGE_ERROR_NO_ERROR);
@@ -494,11 +479,6 @@ void ServiceWorkerCacheStorage::DeleteCache(
return;
}
- if (cache_name.empty()) {
- callback.Run(false, CACHE_STORAGE_ERROR_EMPTY_KEY);
- return;
- }
-
scoped_ptr<CacheContext> cache_context(GetLoadedCache(cache_name));
if (!cache_context) {
callback.Run(false, CACHE_STORAGE_ERROR_NOT_FOUND);

Powered by Google App Engine
This is Rietveld 408576698