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

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

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: 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
Index: content/browser/cache_storage/cache_storage_dispatcher_host.cc
diff --git a/content/browser/cache_storage/cache_storage_dispatcher_host.cc b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
index af73b7872768cbbf61278a4ad012b91fa92602ef..1cb817d1582d78c130932a9ff2f8df3493e457c9 100644
--- a/content/browser/cache_storage/cache_storage_dispatcher_host.cc
+++ b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
@@ -11,7 +11,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/strings/string16.h"
-#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "content/browser/bad_message.h"
#include "content/browser/cache_storage/cache_storage_cache.h"
@@ -122,7 +121,7 @@ void CacheStorageDispatcherHost::OnCacheStorageHas(
return;
}
context_->cache_manager()->HasCache(
- origin, base::UTF16ToUTF8(cache_name),
+ origin, cache_name,
base::Bind(&CacheStorageDispatcherHost::OnCacheStorageHasCallback, this,
thread_id, request_id));
}
@@ -139,7 +138,7 @@ void CacheStorageDispatcherHost::OnCacheStorageOpen(
return;
}
context_->cache_manager()->OpenCache(
- origin, base::UTF16ToUTF8(cache_name),
+ origin, cache_name,
base::Bind(&CacheStorageDispatcherHost::OnCacheStorageOpenCallback, this,
thread_id, request_id));
}
@@ -156,7 +155,7 @@ void CacheStorageDispatcherHost::OnCacheStorageDelete(
return;
}
context_->cache_manager()->DeleteCache(
- origin, base::UTF16ToUTF8(cache_name),
+ origin, cache_name,
base::Bind(&CacheStorageDispatcherHost::OnCacheStorageDeleteCallback,
this, thread_id, request_id));
}
@@ -201,8 +200,7 @@ void CacheStorageDispatcherHost::OnCacheStorageMatch(
return;
}
context_->cache_manager()->MatchCache(
- origin, base::UTF16ToUTF8(match_params.cache_name),
- std::move(scoped_request),
+ origin, match_params.cache_name, std::move(scoped_request),
base::Bind(&CacheStorageDispatcherHost::OnCacheStorageMatchCallback, this,
thread_id, request_id));
}
@@ -362,7 +360,7 @@ void CacheStorageDispatcherHost::OnCacheStorageDeleteCallback(
void CacheStorageDispatcherHost::OnCacheStorageKeysCallback(
int thread_id,
int request_id,
- const std::vector<std::string>& strings,
+ const std::vector<base::string16>& cache_names,
CacheStorageError error) {
if (error != CACHE_STORAGE_OK) {
Send(new CacheStorageMsg_CacheStorageKeysError(
@@ -370,12 +368,8 @@ void CacheStorageDispatcherHost::OnCacheStorageKeysCallback(
return;
}
- std::vector<base::string16> string16s;
- for (size_t i = 0, max = strings.size(); i < max; ++i) {
- string16s.push_back(base::UTF8ToUTF16(strings[i]));
- }
Send(new CacheStorageMsg_CacheStorageKeysSuccess(thread_id, request_id,
- string16s));
+ cache_names));
}
void CacheStorageDispatcherHost::OnCacheStorageMatchCallback(

Powered by Google App Engine
This is Rietveld 408576698