Bug 1874684 - Part 6: Limit day length calculations to safe integers. r=mgaudet
[gecko.git] / dom / quota / ForwardDecls.h
blob01868c4ef9985cb788a8a9cdd2ccfafe75352f7b
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_QUOTA_FORWARD_DECLS_H_
8 #define DOM_QUOTA_FORWARD_DECLS_H_
10 #include <cstdint>
11 #include <functional>
13 #include "mozilla/dom/quota/Config.h"
15 enum class nsresult : uint32_t;
16 template <class T>
17 class RefPtr;
19 namespace mozilla {
21 #ifdef QM_ERROR_STACKS_ENABLED
22 class QMResult;
23 #else
24 using QMResult = nsresult;
25 #endif
27 struct Ok;
28 template <typename V, typename E>
29 class Result;
31 using OkOrErr = Result<Ok, QMResult>;
33 template <typename ResolveValueT, typename RejectValueT, bool IsExclusive>
34 class MozPromise;
36 using BoolPromise = MozPromise<bool, nsresult, false>;
37 using Int64Promise = MozPromise<int64_t, nsresult, false>;
39 namespace ipc {
41 class BoolResponse;
42 enum class ResponseRejectReason;
44 using BoolResponsePromise =
45 MozPromise<BoolResponse, ResponseRejectReason, true>;
46 using BoolResponseResolver = std::function<void(const BoolResponse&)>;
48 } // namespace ipc
50 namespace dom::quota {
52 class ClientDirectoryLock;
53 class UniversalDirectoryLock;
55 using ClientDirectoryLockPromise =
56 MozPromise<RefPtr<ClientDirectoryLock>, nsresult, true>;
57 using UniversalDirectoryLockPromise =
58 MozPromise<RefPtr<UniversalDirectoryLock>, nsresult, true>;
60 } // namespace dom::quota
62 } // namespace mozilla
64 #endif // DOM_QUOTA_FORWARD_DECLS_H_