/work/obj-fuzz/dist/include/mozilla/dom/PushSubscriptionOptions.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #ifndef mozilla_dom_PushSubscriptionOptions_h |
8 | | #define mozilla_dom_PushSubscriptionOptions_h |
9 | | |
10 | | #include "nsCycleCollectionParticipant.h" |
11 | | #include "nsTArray.h" |
12 | | #include "nsWrapperCache.h" |
13 | | #include "mozilla/dom/DOMPrefs.h" |
14 | | |
15 | | class nsIGlobalObject; |
16 | | |
17 | | namespace mozilla { |
18 | | |
19 | | class ErrorResult; |
20 | | |
21 | | namespace dom { |
22 | | |
23 | | class PushSubscriptionOptions final : public nsISupports |
24 | | , public nsWrapperCache |
25 | | { |
26 | | public: |
27 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
28 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PushSubscriptionOptions) |
29 | | |
30 | | PushSubscriptionOptions(nsIGlobalObject* aGlobal, |
31 | | nsTArray<uint8_t>&& aRawAppServerKey); |
32 | | |
33 | | nsIGlobalObject* |
34 | | GetParentObject() const |
35 | 0 | { |
36 | 0 | return mGlobal; |
37 | 0 | } |
38 | | |
39 | | JSObject* |
40 | | WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
41 | | |
42 | | void |
43 | | GetApplicationServerKey(JSContext* aCx, |
44 | | JS::MutableHandle<JSObject*> aKey, |
45 | | ErrorResult& aRv); |
46 | | |
47 | | private: |
48 | | ~PushSubscriptionOptions(); |
49 | | |
50 | | nsCOMPtr<nsIGlobalObject> mGlobal; |
51 | | nsTArray<uint8_t> mRawAppServerKey; |
52 | | JS::Heap<JSObject*> mAppServerKey; |
53 | | }; |
54 | | |
55 | | } // namespace dom |
56 | | } // namespace mozilla |
57 | | |
58 | | #endif // mozilla_dom_PushSubscriptionOptions_h |