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_PushSubscriptionOptions_h
8 #define mozilla_dom_PushSubscriptionOptions_h
10 #include "js/RootingAPI.h"
11 #include "js/TypeDecls.h"
12 #include "mozilla/dom/ServiceWorkerUtils.h"
14 #include "nsCycleCollectionParticipant.h"
16 #include "nsWrapperCache.h"
18 class nsIGlobalObject
;
26 class PushSubscriptionOptions final
: public nsISupports
,
27 public nsWrapperCache
{
29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
30 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PushSubscriptionOptions
)
32 PushSubscriptionOptions(nsIGlobalObject
* aGlobal
,
33 nsTArray
<uint8_t>&& aRawAppServerKey
);
35 nsIGlobalObject
* GetParentObject() const { return mGlobal
; }
37 JSObject
* WrapObject(JSContext
* aCx
,
38 JS::Handle
<JSObject
*> aGivenProto
) override
;
40 void GetApplicationServerKey(JSContext
* aCx
,
41 JS::MutableHandle
<JSObject
*> aKey
,
45 ~PushSubscriptionOptions();
47 nsCOMPtr
<nsIGlobalObject
> mGlobal
;
48 nsTArray
<uint8_t> mRawAppServerKey
;
49 JS::Heap
<JSObject
*> mAppServerKey
;
53 } // namespace mozilla
55 #endif // mozilla_dom_PushSubscriptionOptions_h