chromium/third_party/blink/renderer/platform/network/form_data_encoder.cc

/*
 * Copyright (C) 1999 Lars Knoll ([email protected])
 *           (C) 1999 Antti Koivisto ([email protected])
 *           (C) 2001 Dirk Mueller ([email protected])
 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
 *           (C) 2006 Alexey Proskuryakov ([email protected])
 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
 * (http://www.torchmobile.com/)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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 {

// Helper functions
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) {}

}  // namespace

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) {}

}  // namespace blink