#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/error_page/common/alt_game_images.h"
#include <memory>
#include <string>
#include "base/base64url.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/rand_util.h"
#include "base/strings/string_util.h"
#include "components/error_page/common/error_page_switches.h"
#include "crypto/encryptor.h"
#include "crypto/symmetric_key.h"
namespace error_page {
namespace {
const uint8_t kAltGameImages1xA[] = …;
const uint8_t kAltGameImages1xB[] = …;
const uint8_t* const kAltGameImages1x[] = …;
constexpr int kAltGameImagesCount = …;
const size_t kAltGameImages1xLength[] = …;
static_assert …;
const uint8_t kAltGameImages2xA[] = …;
const uint8_t kAltGameImages2xB[] = …;
const uint8_t* const kAltGameImages2x[] = …;
const size_t kAltGameImages2xLength[] = …;
static_assert …;
static_assert …;
std::string DecryptImage(const std::string& image_ciphertext,
crypto::SymmetricKey* key) { … }
bool LookupImage(int id, int scale, std::string* image) { … }
std::unique_ptr<crypto::SymmetricKey> GetKey() { … }
}
BASE_FEATURE(…);
const base::FeatureParam<std::string> kNetErrorAltGameModeKey{ … };
bool EnableAltGameMode() { … }
std::string GetAltGameImage(int image_id, int scale) { … }
int ChooseAltGame() { … }
}