Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / push / PushSubscriptionOptions.h
blob03722edab191b156bfacaa4cc6b0b2b7def38be3
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 "nsCOMPtr.h"
13 #include "nsCycleCollectionParticipant.h"
14 #include "nsTArray.h"
15 #include "nsWrapperCache.h"
17 class nsIGlobalObject;
19 namespace mozilla {
21 class ErrorResult;
23 namespace dom {
25 bool ServiceWorkerVisible(JSContext* aCx, JSObject* aGlobal);
27 class PushSubscriptionOptions final : public nsISupports,
28 public nsWrapperCache {
29 public:
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,
43 ErrorResult& aRv);
45 private:
46 ~PushSubscriptionOptions();
48 nsCOMPtr<nsIGlobalObject> mGlobal;
49 nsTArray<uint8_t> mRawAppServerKey;
50 JS::Heap<JSObject*> mAppServerKey;
53 } // namespace dom
54 } // namespace mozilla
56 #endif // mozilla_dom_PushSubscriptionOptions_h