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_
13 #include "mozilla/dom/quota/Config.h"
15 enum class nsresult
: uint32_t;
21 #ifdef QM_ERROR_STACKS_ENABLED
24 using QMResult
= nsresult
;
28 template <typename V
, typename E
>
31 using OkOrErr
= Result
<Ok
, QMResult
>;
33 template <typename ResolveValueT
, typename RejectValueT
, bool IsExclusive
>
36 using BoolPromise
= MozPromise
<bool, nsresult
, false>;
37 using Int64Promise
= MozPromise
<int64_t, nsresult
, false>;
42 enum class ResponseRejectReason
;
44 using BoolResponsePromise
=
45 MozPromise
<BoolResponse
, ResponseRejectReason
, true>;
46 using BoolResponseResolver
= std::function
<void(const BoolResponse
&)>;
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_