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

Unified Diff: net/http/http_util.cc

Issue 2746653002: net: make use of base::Erase() in AssembleRawHeaders() (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.cc
diff --git a/net/http/http_util.cc b/net/http/http_util.cc
index 62bed8c449c09098bd5d703be0a7172066d2050d..24f49e742e48d4ffd183d5746bff60d922da8b91 100644
--- a/net/http/http_util.cc
+++ b/net/http/http_util.cc
@@ -10,6 +10,7 @@
#include <algorithm>
#include "base/logging.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_tokenizer.h"
@@ -707,8 +708,8 @@ std::string HttpUtil::AssembleRawHeaders(const char* input_begin,
// Use '\0' as the canonical line terminator. If the input already contained
// any embeded '\0' characters we will strip them first to avoid interpreting
// them as line breaks.
- raw_headers.erase(std::remove(raw_headers.begin(), raw_headers.end(), '\0'),
- raw_headers.end());
+ base::Erase(raw_headers, '\0');
+
std::replace(raw_headers.begin(), raw_headers.end(), '\n', '\0');
return raw_headers;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698