#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "content/browser/webauth/client_data_json.h"
#include <string_view>
#include "base/base64url.h"
#include "base/check.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversion_utils.h"
#include "content/public/common/content_features.h"
namespace content {
namespace {
std::string Base64UrlEncode(const base::span<const uint8_t> input) { … }
std::string ToJSONString(std::string_view in) { … }
}
ClientDataJsonParams::ClientDataJsonParams(ClientDataRequestType type,
url::Origin origin,
url::Origin top_origin,
std::vector<uint8_t> challenge,
bool is_cross_origin_iframe)
: … { … }
ClientDataJsonParams::ClientDataJsonParams(ClientDataJsonParams&&) = default;
ClientDataJsonParams& ClientDataJsonParams::operator=(ClientDataJsonParams&&) =
default;
ClientDataJsonParams::~ClientDataJsonParams() = default;
std::string BuildClientDataJson(ClientDataJsonParams params) { … }
}