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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_serviceworkeroppromise_h__
8 #define mozilla_dom_serviceworkeroppromise_h__
12 #include "mozilla/MozPromise.h"
13 #include "mozilla/Tuple.h"
14 #include "mozilla/dom/SafeRefPtr.h"
15 #include "mozilla/dom/ServiceWorkerOpArgs.h"
20 class InternalResponse
;
22 using SynthesizeResponseArgs
=
23 Tuple
<SafeRefPtr
<InternalResponse
>, FetchEventRespondWithClosure
,
24 FetchEventTimeStamps
>;
26 using FetchEventRespondWithResult
=
27 Variant
<SynthesizeResponseArgs
, ResetInterceptionArgs
,
28 CancelInterceptionArgs
>;
30 using FetchEventRespondWithPromise
=
31 MozPromise
<FetchEventRespondWithResult
, CancelInterceptionArgs
, true>;
33 // The reject type int is arbitrary, since this promise will never get rejected.
34 // Unfortunately void is not supported as a reject type.
35 using FetchEventPreloadResponsePromise
=
36 MozPromise
<SafeRefPtr
<InternalResponse
>, int, true>;
38 using ServiceWorkerOpPromise
=
39 MozPromise
<ServiceWorkerOpResult
, nsresult
, true>;
41 using ServiceWorkerFetchEventOpPromise
=
42 MozPromise
<ServiceWorkerFetchEventOpResult
, nsresult
, true>;
45 } // namespace mozilla
47 #endif // mozilla_dom_serviceworkeroppromise_h__