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

Unified Diff: content/browser/cache_storage/cache_storage.cc

Issue 1132683003: CacheStorage: Merge CacheStorage::CacheStorageError and CacheStorageCache::ErrorType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix more Created 5 years, 7 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 | « content/browser/cache_storage/cache_storage.h ('k') | content/browser/cache_storage/cache_storage_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/cache_storage/cache_storage.cc
diff --git a/content/browser/cache_storage/cache_storage.cc b/content/browser/cache_storage/cache_storage.cc
index bca88cd7b8b7dd718910227db663c0068594ab05..c49daa14a3f80bedfd4da4beded626dc242b1c69 100644
--- a/content/browser/cache_storage/cache_storage.cc
+++ b/content/browser/cache_storage/cache_storage.cc
@@ -560,7 +560,7 @@ void CacheStorage::OpenCacheImpl(const std::string& cache_name,
const CacheAndErrorCallback& callback) {
scoped_refptr<CacheStorageCache> cache = GetLoadedCache(cache_name);
if (cache.get()) {
- callback.Run(cache, CACHE_STORAGE_ERROR_NO_ERROR);
+ callback.Run(cache, CACHE_STORAGE_OK);
return;
}
@@ -577,7 +577,7 @@ void CacheStorage::CreateCacheDidCreateCache(
if (!cache.get()) {
callback.Run(scoped_refptr<CacheStorageCache>(),
- CACHE_STORAGE_ERROR_CLOSING);
+ CACHE_STORAGE_ERROR_STORAGE);
return;
}
@@ -602,14 +602,14 @@ void CacheStorage::CreateCacheDidWriteIndex(
// TODO(jkarlin): Handle !success.
- callback.Run(cache, CACHE_STORAGE_ERROR_NO_ERROR);
+ callback.Run(cache, CACHE_STORAGE_OK);
}
void CacheStorage::HasCacheImpl(const std::string& cache_name,
const BoolAndErrorCallback& callback) {
bool has_cache = cache_map_.find(cache_name) != cache_map_.end();
- callback.Run(has_cache, CACHE_STORAGE_ERROR_NO_ERROR);
+ callback.Run(has_cache, CACHE_STORAGE_OK);
}
void CacheStorage::DeleteCacheImpl(const std::string& cache_name,
@@ -668,12 +668,12 @@ void CacheStorage::DeleteCacheDidCleanUp(const BoolAndErrorCallback& callback,
bool success) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- callback.Run(true, CACHE_STORAGE_ERROR_NO_ERROR);
+ callback.Run(true, CACHE_STORAGE_OK);
}
void CacheStorage::EnumerateCachesImpl(
const StringsAndErrorCallback& callback) {
- callback.Run(ordered_cache_names_, CACHE_STORAGE_ERROR_NO_ERROR);
+ callback.Run(ordered_cache_names_, CACHE_STORAGE_OK);
}
void CacheStorage::MatchCacheImpl(
@@ -683,7 +683,7 @@ void CacheStorage::MatchCacheImpl(
scoped_refptr<CacheStorageCache> cache = GetLoadedCache(cache_name);
if (!cache.get()) {
- callback.Run(CacheStorageCache::ERROR_TYPE_NOT_FOUND,
+ callback.Run(CACHE_STORAGE_ERROR_NOT_FOUND,
scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>());
return;
@@ -699,7 +699,7 @@ void CacheStorage::MatchCacheImpl(
void CacheStorage::MatchCacheDidMatch(
const scoped_refptr<CacheStorageCache>& cache,
const CacheStorageCache::ResponseCallback& callback,
- CacheStorageCache::ErrorType error,
+ CacheStorageError error,
scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> handle) {
callback.Run(error, response.Pass(), handle.Pass());
@@ -733,10 +733,10 @@ void CacheStorage::MatchAllCachesDidMatch(
scoped_refptr<CacheStorageCache> cache,
const base::Closure& barrier_closure,
CacheStorageCache::ResponseCallback* callback,
- CacheStorageCache::ErrorType error,
+ CacheStorageError error,
scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> handle) {
- if (callback->is_null() || error == CacheStorageCache::ERROR_TYPE_NOT_FOUND) {
+ if (callback->is_null() || error == CACHE_STORAGE_ERROR_NOT_FOUND) {
barrier_closure.Run();
return;
}
@@ -749,7 +749,7 @@ void CacheStorage::MatchAllCachesDidMatch(
void CacheStorage::MatchAllCachesDidMatchAll(
scoped_ptr<CacheStorageCache::ResponseCallback> callback) {
if (!callback->is_null()) {
- callback->Run(CacheStorageCache::ERROR_TYPE_NOT_FOUND,
+ callback->Run(CACHE_STORAGE_ERROR_NOT_FOUND,
scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>());
}
@@ -847,7 +847,7 @@ void CacheStorage::PendingStringsAndErrorCallback(
void CacheStorage::PendingResponseCallback(
const CacheStorageCache::ResponseCallback& callback,
- CacheStorageCache::ErrorType error,
+ CacheStorageError error,
scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> blob_data_handle) {
base::WeakPtr<CacheStorage> cache_storage = weak_factory_.GetWeakPtr();
« no previous file with comments | « content/browser/cache_storage/cache_storage.h ('k') | content/browser/cache_storage/cache_storage_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698