1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef DOM_QUOTA_FORWARD_DECLS_H_
#define DOM_QUOTA_FORWARD_DECLS_H_
#include <cstdint>
#include <functional>
#include "mozilla/dom/quota/CommonMetadataArrayFwd.h"
#include "mozilla/dom/quota/Config.h"
#include "nsStringFwd.h"
#include "nsTArrayForwardDeclare.h"
enum class nsresult : uint32_t;
template <class T>
class RefPtr;
namespace mozilla {
using CStringArray = nsTArray<nsCString>;
template <class T>
class Maybe;
using MaybeCStringArray = Maybe<CStringArray>;
#ifdef QM_ERROR_STACKS_ENABLED
class QMResult;
#else
using QMResult = nsresult;
#endif
struct Ok;
template <typename V, typename E>
class Result;
using OkOrErr = Result<Ok, QMResult>;
template <typename ResolveValueT, typename RejectValueT, bool IsExclusive>
class MozPromise;
using BoolPromise = MozPromise<bool, nsresult, false>;
using Int64Promise = MozPromise<int64_t, nsresult, false>;
using UInt64Promise = MozPromise<uint64_t, nsresult, false>;
using CStringArrayPromise = MozPromise<CStringArray, nsresult, true>;
using MaybeCStringArrayPromise = MozPromise<MaybeCStringArray, nsresult, true>;
using ExclusiveBoolPromise = MozPromise<bool, nsresult, true>;
namespace ipc {
class BoolResponse;
class UInt64Response;
class CStringArrayResponse;
enum class ResponseRejectReason;
using BoolResponsePromise =
MozPromise<BoolResponse, ResponseRejectReason, true>;
using UInt64ResponsePromise =
MozPromise<UInt64Response, ResponseRejectReason, true>;
using CStringArrayResponsePromise =
MozPromise<CStringArrayResponse, ResponseRejectReason, true>;
using NSResultResolver = std::function<void(const nsresult&)>;
using BoolResponseResolver = std::function<void(const BoolResponse&)>;
using UInt64ResponseResolver = std::function<void(const UInt64Response&)>;
using CStringArrayResponseResolver =
std::function<void(const CStringArrayResponse&)>;
} // namespace ipc
namespace dom::quota {
class ClientDirectoryLock;
class UniversalDirectoryLock;
using ClientDirectoryLockPromise =
MozPromise<RefPtr<ClientDirectoryLock>, nsresult, true>;
using UniversalDirectoryLockPromise =
MozPromise<RefPtr<UniversalDirectoryLock>, nsresult, true>;
struct ClientMetadata;
struct OriginMetadata;
struct PrincipalMetadata;
using ClientMetadataArray = nsTArray<ClientMetadata>;
using OriginMetadataArray = nsTArray<OriginMetadata>;
using PrincipalMetadataArray = nsTArray<PrincipalMetadata>;
using MaybePrincipalMetadataArray = Maybe<PrincipalMetadataArray>;
class UsageInfo;
using ClientMetadataArrayPromise =
MozPromise<ClientMetadataArray, nsresult, true>;
using OriginMetadataArrayPromise =
MozPromise<OriginMetadataArray, nsresult, true>;
using OriginUsageMetadataArrayPromise =
MozPromise<OriginUsageMetadataArray, nsresult, true>;
using MaybePrincipalMetadataArrayPromise =
MozPromise<MaybePrincipalMetadataArray, nsresult, true>;
using UsageInfoPromise = MozPromise<UsageInfo, nsresult, false>;
class OriginUsageMetadataArrayResponse;
class UsageInfoResponse;
using OriginUsageMetadataArrayResponsePromise =
MozPromise<OriginUsageMetadataArrayResponse,
mozilla::ipc::ResponseRejectReason, true>;
using UsageInfoResponsePromise =
MozPromise<UsageInfoResponse, mozilla::ipc::ResponseRejectReason, true>;
using OriginUsageMetadataArrayResponseResolver =
std::function<void(OriginUsageMetadataArrayResponse&&)>;
using UsageInfoResponseResolver = std::function<void(const UsageInfoResponse&)>;
} // namespace dom::quota
} // namespace mozilla
#endif // DOM_QUOTA_FORWARD_DECLS_H_
|