chromium/components/manta/manta_service_callbacks.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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[] =;

// Maps the RpcErrorInfo.reason to MantaStatusCode.
std::optional<MantaStatusCode> MapServerFailureReasonToMantaStatusCode(
    const std::string& reason) {}

// Maps the RpcStatus.code to MantaStatusCode.
// The RpcStatus.code is an enum value of google.rpc.Code.
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) {}
}  // namespace

void OnEndpointFetcherComplete(MantaProtoResponseCallback callback,
                               const base::Time& start_time,
                               const MantaMetricType request_type,
                               std::unique_ptr<EndpointFetcher> fetcher,
                               std::unique_ptr<EndpointResponse> responses) {}

}  // namespace manta