chromium/components/services/storage/public/cpp/quota_error_or.h

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

#ifndef COMPONENTS_SERVICES_STORAGE_PUBLIC_CPP_QUOTA_ERROR_OR_H_
#define COMPONENTS_SERVICES_STORAGE_PUBLIC_CPP_QUOTA_ERROR_OR_H_

#include <tuple>

#include "base/types/expected.h"

namespace storage {

// These values are logged to UMA. Entries should not be renumbered and numeric
// values should never be reused. Please keep in sync with "QuotaError" in
// tools/metrics/histograms/enums.xml.
enum class QuotaError {};

struct DetailedQuotaError {};

constexpr bool operator==(QuotaError error,
                          const DetailedQuotaError& detailed_error) {}
constexpr bool operator!=(QuotaError error,
                          const DetailedQuotaError& detailed_error) {}

// Helper for methods which perform database operations which may fail. Objects
// of this type can on either a QuotaError or a result value of arbitrary type.
QuotaErrorOr;

}  // namespace storage

#endif  // COMPONENTS_SERVICES_STORAGE_PUBLIC_CPP_QUOTA_ERROR_OR_H_