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

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: Rebasing... Created 4 years, 11 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: components/search_engines/template_url.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index a75779bfb0d1cfe09f393076650d7671f5e13ca3..dcf45f89d6f174f9a5e8d26a23926452ba58f657 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -14,7 +14,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/metrics/field_trial.h"
-#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
@@ -277,12 +276,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