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

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

Issue 1768063002: Introduce String::fromUTF8Lenient() and use it for cache_name in CacheStorage API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated jsbell's comment Created 4 years, 9 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 05e356818f7e849ece22a094efc4d8994414d8dd..61b22f570e2291625b71a111cbf30a8080ee0ac4 100644
--- a/content/browser/cache_storage/cache_storage_dispatcher_host.cc
+++ b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
@@ -10,8 +10,6 @@
#include "base/bind.h"
#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"
@@ -115,14 +113,14 @@ void CacheStorageDispatcherHost::OnCacheStorageHas(
int thread_id,
int request_id,
const GURL& origin,
- const base::string16& cache_name) {
+ const std::string& cache_name) {
TRACE_EVENT0("CacheStorage", "CacheStorageDispatcherHost::OnCacheStorageHas");
if (!OriginCanAccessCacheStorage(origin)) {
bad_message::ReceivedBadMessage(this, bad_message::CSDH_INVALID_ORIGIN);
return;
}
context_->cache_manager()->HasCache(
- origin, base::UTF16ToUTF8(cache_name),
+ origin, cache_name,
base::Bind(&CacheStorageDispatcherHost::OnCacheStorageHasCallback, this,
thread_id, request_id));
}
@@ -131,7 +129,7 @@ void CacheStorageDispatcherHost::OnCacheStorageOpen(
int thread_id,
int request_id,
const GURL& origin,
- const base::string16& cache_name) {
+ const std::string& cache_name) {
TRACE_EVENT0("CacheStorage",
"CacheStorageDispatcherHost::OnCacheStorageOpen");
if (!OriginCanAccessCacheStorage(origin)) {
@@ -139,7 +137,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));
}
@@ -148,7 +146,7 @@ void CacheStorageDispatcherHost::OnCacheStorageDelete(
int thread_id,
int request_id,
const GURL& origin,
- const base::string16& cache_name) {
+ const std::string& cache_name) {
TRACE_EVENT0("CacheStorage",
"CacheStorageDispatcherHost::OnCacheStorageDelete");
if (!OriginCanAccessCacheStorage(origin)) {
@@ -156,7 +154,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 +199,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));
}
@@ -370,12 +367,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));
+ strings));
}
void CacheStorageDispatcherHost::OnCacheStorageMatchCallback(
« no previous file with comments | « content/browser/cache_storage/cache_storage_dispatcher_host.h ('k') | content/common/cache_storage/cache_storage_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698