chromium/net/http/http_connection_info.h

// 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.

#ifndef NET_HTTP_HTTP_CONNECTION_INFO_H_
#define NET_HTTP_HTTP_CONNECTION_INFO_H_

#include <string_view>

#include "net/base/net_export.h"

namespace net {

// Describes the kind of connection used to fetch this response.
//
// NOTE: Please keep in sync with ConnectionInfo enum in
// tools/metrics/histograms/metadata/net/enums.xml.
// Because of that, and also because these values are persisted to
// the cache, please make sure not to delete or reorder values.
enum class HttpConnectionInfo {};

enum class HttpConnectionInfoCoarse {};

NET_EXPORT std::string_view HttpConnectionInfoToString(
    HttpConnectionInfo connection_info);

NET_EXPORT std::string_view HttpConnectionInfoCoarseToString(
    HttpConnectionInfoCoarse http_connection_info_coarse);

// Returns a more coarse-grained description of the protocol used to fetch the
// response.
NET_EXPORT HttpConnectionInfoCoarse
HttpConnectionInfoToCoarse(HttpConnectionInfo info);

}  // namespace net

#endif  // NET_HTTP_HTTP_CONNECTION_INFO_H_