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

Unified Diff: components/search_engines/template_url.cc

Issue 1547593002: Introducing a net::GenerateMimeMultipartBoundary helper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self-review. Created 5 years 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: components/search_engines/template_url.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index 4bc489192d659d74fd163bb0b58f59ec12b61346..4a3b0aefe969b11888b82244dcbe842cdc3e4b9d 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -278,12 +278,9 @@ bool TemplateURLRef::EncodeFormData(const PostParams& post_params,
return false;
const char kUploadDataMIMEType[] = "multipart/form-data; boundary=";
- const char kMultipartBoundary[] = "----+*+----%016" PRIx64 "----+*+----";
// Each name/value pair is stored in a body part which is preceded by a
- // boundary delimiter line. Uses random number generator here to create
- // a unique boundary delimiter for form data encoding.
- std::string boundary = base::StringPrintf(kMultipartBoundary,
- base::RandUint64());
+ // boundary delimiter line.
+ std::string boundary = net::GenerateMimeMultipartBoundary();
// Sets the content MIME type.
post_content->first = kUploadDataMIMEType;
post_content->first += boundary;

Powered by Google App Engine
This is Rietveld 408576698