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

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

Issue 1751833002: Use string16 for cache_name in the back end of CacheStorage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment and test Created 4 years, 10 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/cache_storage/cache_storage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/cache_storage/cache_storage.h
diff --git a/content/browser/cache_storage/cache_storage.h b/content/browser/cache_storage/cache_storage.h
index e5aac76ea6e414ec290e9ab9f6c70efbb56774fc..654b57dab493a62f82a452a0600afcc5a62c85e1 100644
--- a/content/browser/cache_storage/cache_storage.h
+++ b/content/browser/cache_storage/cache_storage.h
@@ -15,6 +15,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "base/strings/string16.h"
#include "content/browser/cache_storage/cache_storage_cache.h"
namespace base {
@@ -39,7 +40,7 @@ class CacheStorageScheduler;
// on the IO thread. The asynchronous methods are executed serially.
class CONTENT_EXPORT CacheStorage {
public:
- typedef std::vector<std::string> StringVector;
+ typedef std::vector<base::string16> StringVector;
typedef base::Callback<void(bool, CacheStorageError)> BoolAndErrorCallback;
typedef base::Callback<void(const scoped_refptr<CacheStorageCache>&,
CacheStorageError)> CacheAndErrorCallback;
@@ -64,23 +65,23 @@ class CONTENT_EXPORT CacheStorage {
// Get the cache for the given key. If the cache is not found it is
// created.
- void OpenCache(const std::string& cache_name,
+ void OpenCache(const base::string16& cache_name,
const CacheAndErrorCallback& callback);
// Calls the callback with whether or not the cache exists.
- void HasCache(const std::string& cache_name,
+ void HasCache(const base::string16& cache_name,
const BoolAndErrorCallback& callback);
// Deletes the cache if it exists. If it doesn't exist,
// CACHE_STORAGE_ERROR_NOT_FOUND is returned.
- void DeleteCache(const std::string& cache_name,
+ void DeleteCache(const base::string16& cache_name,
const BoolAndErrorCallback& callback);
// Calls the callback with a vector of cache names (keys) available.
void EnumerateCaches(const StringsAndErrorCallback& callback);
// Calls match on the cache with the given |cache_name|.
- void MatchCache(const std::string& cache_name,
+ void MatchCache(const base::string16& cache_name,
scoped_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCache::ResponseCallback& callback);
@@ -112,12 +113,12 @@ class CONTENT_EXPORT CacheStorage {
class SimpleCacheLoader;
class CacheLoader;
- typedef std::map<std::string, base::WeakPtr<CacheStorageCache>> CacheMap;
+ typedef std::map<base::string16, base::WeakPtr<CacheStorageCache>> CacheMap;
// Return a CacheStorageCache for the given name if the name is known. If the
// CacheStorageCache has been deleted, creates a new one.
scoped_refptr<CacheStorageCache> GetLoadedCache(
- const std::string& cache_name);
+ const base::string16& cache_name);
// Holds a reference to a cache for thirty seconds.
void TemporarilyPreserveCache(const scoped_refptr<CacheStorageCache>& cache);
@@ -129,12 +130,12 @@ class CONTENT_EXPORT CacheStorage {
void LazyInit();
void LazyInitImpl();
void LazyInitDidLoadIndex(
- scoped_ptr<std::vector<std::string>> indexed_cache_names);
+ scoped_ptr<std::vector<base::string16>> indexed_cache_names);
// The Open and CreateCache callbacks are below.
- void OpenCacheImpl(const std::string& cache_name,
+ void OpenCacheImpl(const base::string16& cache_name,
const CacheAndErrorCallback& callback);
- void CreateCacheDidCreateCache(const std::string& cache_name,
+ void CreateCacheDidCreateCache(const base::string16& cache_name,
const CacheAndErrorCallback& callback,
const scoped_refptr<CacheStorageCache>& cache);
void CreateCacheDidWriteIndex(const CacheAndErrorCallback& callback,
@@ -142,19 +143,19 @@ class CONTENT_EXPORT CacheStorage {
bool success);
// The HasCache callbacks are below.
- void HasCacheImpl(const std::string& cache_name,
+ void HasCacheImpl(const base::string16& cache_name,
const BoolAndErrorCallback& callback);
// The DeleteCache callbacks are below.
- void DeleteCacheImpl(const std::string& cache_name,
+ void DeleteCacheImpl(const base::string16& cache_name,
const BoolAndErrorCallback& callback);
- void DeleteCacheDidClose(const std::string& cache_name,
+ void DeleteCacheDidClose(const base::string16& cache_name,
const BoolAndErrorCallback& callback,
const StringVector& ordered_cache_names,
const scoped_refptr<CacheStorageCache>& cache,
int64_t cache_size);
- void DeleteCacheDidWriteIndex(const std::string& cache_name,
+ void DeleteCacheDidWriteIndex(const base::string16& cache_name,
const BoolAndErrorCallback& callback,
int cache_size,
bool success);
@@ -165,7 +166,7 @@ class CONTENT_EXPORT CacheStorage {
void EnumerateCachesImpl(const StringsAndErrorCallback& callback);
// The MatchCache callbacks are below.
- void MatchCacheImpl(const std::string& cache_name,
+ void MatchCacheImpl(const base::string16& cache_name,
scoped_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCache::ResponseCallback& callback);
void MatchCacheDidMatch(const scoped_refptr<CacheStorageCache>& cache,
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698