#include "components/manta/manta_service_callbacks.h"
#include <memory>
#include <string>
#include <string_view>
#include "base/containers/fixed_flat_map.h"
#include "base/functional/callback.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "components/endpoint_fetcher/endpoint_fetcher.h"
#include "components/manta/manta_status.h"
#include "components/manta/proto/manta.pb.h"
#include "components/manta/proto/rpc_status.pb.h"
#include "net/http/http_status_code.h"
namespace manta {
namespace {
constexpr char kTypeUrlRpcErrorInfo[] = …;
constexpr char kTypeUrlRpcLocalizedMessage[] = …;
constexpr char kExpectedEndPointDomain[] = …;
std::optional<MantaStatusCode> MapServerFailureReasonToMantaStatusCode(
const std::string& reason) { … }
std::optional<MantaStatusCode> MapServerStatusCodeToMantaStatusCode(
const int32_t server_status_code) { … }
void LogTimeCost(const MantaMetricType request_type,
const base::TimeDelta& time_cost) { … }
void LogMantaStatusCode(const MantaMetricType request_type,
const MantaStatusCode status_code) { … }
}
void OnEndpointFetcherComplete(MantaProtoResponseCallback callback,
const base::Time& start_time,
const MantaMetricType request_type,
std::unique_ptr<EndpointFetcher> fetcher,
std::unique_ptr<EndpointResponse> responses) { … }
}