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

Unified Diff: content/renderer/service_worker/service_worker_type_util.cc

Issue 1372423002: [Service Workers] DCHECK from WebServiceWorkerResponse::visitHTTPHeaderFields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added LayoutTest. Created 5 years, 2 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/renderer/service_worker/service_worker_type_util.cc
diff --git a/content/renderer/service_worker/service_worker_type_util.cc b/content/renderer/service_worker/service_worker_type_util.cc
index 720ea2d32a58d56496c197610ee5bca04a63620d..9e5878f2e5fdaa1a47100590a14b254b2e0c8503 100644
--- a/content/renderer/service_worker/service_worker_type_util.cc
+++ b/content/renderer/service_worker/service_worker_type_util.cc
@@ -25,10 +25,9 @@ class HeaderVisitor : public blink::WebHTTPHeaderVisitor {
void visitHeader(const blink::WebString& name,
const blink::WebString& value) override {
- const std::string header_name =
- base::UTF16ToASCII(base::StringPiece16(name));
- const std::string header_value =
- base::UTF16ToASCII(base::StringPiece16(value));
+ // Headers are ISO Latin 1.
+ const std::string& header_name = name.latin1();
+ const std::string& header_value = value.latin1();
CHECK(header_name.find('\0') == std::string::npos);
CHECK(header_value.find('\0') == std::string::npos);
headers_->insert(ServiceWorkerHeaderMap::value_type(

Powered by Google App Engine
This is Rietveld 408576698