#include "components/update_client/request_sender.h"
#include <utility>
#include "base/base64.h"
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "components/client_update_protocol/ecdsa.h"
#include "components/update_client/configurator.h"
#include "components/update_client/network.h"
#include "components/update_client/update_client_errors.h"
#include "components/update_client/utils.h"
namespace update_client {
namespace {
constexpr int kKeyVersion = …;
constexpr char kKeyPubBytesBase64[] = …;
constexpr char kContentType[] = …;
const std::string& SelectCupServerProof(
const std::string& response_cup_server_proof,
const std::string& response_etag) { … }
}
RequestSender::RequestSender(scoped_refptr<Configurator> config)
: … { … }
RequestSender::~RequestSender() = default;
void RequestSender::Send(
const std::vector<GURL>& urls,
const base::flat_map<std::string, std::string>& request_extra_headers,
const std::string& request_body,
bool use_signing,
RequestSenderCallback request_sender_callback) { … }
void RequestSender::SendInternal() { … }
void RequestSender::SendInternalComplete(
int error,
const std::string& response_body,
const std::string& response_etag,
const std::string& response_cup_server_proof,
int retry_after_sec) { … }
void RequestSender::OnResponseStarted(int response_code,
int64_t ) { … }
void RequestSender::OnNetworkFetcherComplete(
const GURL& original_url,
std::unique_ptr<std::string> response_body,
int net_error,
const std::string& header_etag,
const std::string& xheader_cup_server_proof,
int64_t xheader_retry_after_sec) { … }
void RequestSender::HandleSendError(int error, int retry_after_sec) { … }
std::string RequestSender::GetKey(const char* key_bytes_base64) { … }
GURL RequestSender::BuildUpdateUrl(const GURL& url,
const std::string& query_params) { … }
}