#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/network/form_data_encoder.h"
#include <limits>
#include "base/rand_util.h"
#include "third_party/blink/renderer/platform/wtf/text/text_encoding.h"
namespace blink {
static inline void Append(Vector<char>& buffer, char string) { … }
static inline void Append(Vector<char>& buffer, const char* string) { … }
static inline void Append(Vector<char>& buffer, const std::string& string) { … }
static inline void AppendPercentEncoded(Vector<char>& buffer, unsigned char c) { … }
static void AppendQuotedString(Vector<char>& buffer,
const std::string& string,
FormDataEncoder::Mode mode) { … }
namespace {
inline void AppendNormalized(Vector<char>& buffer, const std::string& string) { … }
}
WTF::TextEncoding FormDataEncoder::EncodingFromAcceptCharset(
const String& accept_charset,
const WTF::TextEncoding& fallback_encoding) { … }
Vector<char> FormDataEncoder::GenerateUniqueBoundaryString() { … }
void FormDataEncoder::BeginMultiPartHeader(Vector<char>& buffer,
const std::string& boundary,
const std::string& name) { … }
void FormDataEncoder::AddBoundaryToMultiPartHeader(Vector<char>& buffer,
const std::string& boundary,
bool is_last_boundary) { … }
void FormDataEncoder::AddFilenameToMultiPartHeader(
Vector<char>& buffer,
const WTF::TextEncoding& encoding,
const String& filename) { … }
void FormDataEncoder::AddContentTypeToMultiPartHeader(Vector<char>& buffer,
const String& mime_type) { … }
void FormDataEncoder::FinishMultiPartHeader(Vector<char>& buffer) { … }
void FormDataEncoder::AddKeyValuePairAsFormData(
Vector<char>& buffer,
const std::string& key,
const std::string& value,
EncodedFormData::EncodingType encoding_type,
Mode mode) { … }
void FormDataEncoder::EncodeStringAsFormData(Vector<char>& buffer,
const std::string& string,
Mode mode) { … }
}