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"
13 #include "nsCycleCollectionParticipant.h"
15 #include "nsWrapperCache.h"
17 class nsIGlobalObject
;
25 bool ServiceWorkerVisible(JSContext
* aCx
, JSObject
* aGlobal
);
27 class PushSubscriptionOptions final
: public nsISupports
,
28 public nsWrapperCache
{
30 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
31 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PushSubscriptionOptions
)
33 PushSubscriptionOptions(nsIGlobalObject
* aGlobal
,
34 nsTArray
<uint8_t>&& aRawAppServerKey
);
36 nsIGlobalObject
* GetParentObject() const { return mGlobal
; }
38 JSObject
* WrapObject(JSContext
* aCx
,
39 JS::Handle
<JSObject
*> aGivenProto
) override
;
41 void GetApplicationServerKey(JSContext
* aCx
,
42 JS::MutableHandle
<JSObject
*> aKey
,
46 ~PushSubscriptionOptions();
48 nsCOMPtr
<nsIGlobalObject
> mGlobal
;
49 nsTArray
<uint8_t> mRawAppServerKey
;
50 JS::Heap
<JSObject
*> mAppServerKey
;
54 } // namespace mozilla
56 #endif // mozilla_dom_PushSubscriptionOptions_h