/work/obj-fuzz/dist/include/mozilla/dom/CredentialsContainer.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_CredentialsContainer_h |
8 | | #define mozilla_dom_CredentialsContainer_h |
9 | | |
10 | | #include "mozilla/dom/CredentialManagementBinding.h" |
11 | | |
12 | | namespace mozilla { |
13 | | namespace dom { |
14 | | |
15 | | class WebAuthnManager; |
16 | | |
17 | | class CredentialsContainer final : public nsISupports |
18 | | , public nsWrapperCache |
19 | | { |
20 | | public: |
21 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
22 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CredentialsContainer) |
23 | | |
24 | | explicit CredentialsContainer(nsPIDOMWindowInner* aParent); |
25 | | |
26 | | nsPIDOMWindowInner* |
27 | | GetParentObject() const |
28 | 0 | { |
29 | 0 | return mParent; |
30 | 0 | } |
31 | | |
32 | | virtual JSObject* |
33 | | WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
34 | | |
35 | | already_AddRefed<Promise> |
36 | | Get(const CredentialRequestOptions& aOptions, ErrorResult& aRv); |
37 | | |
38 | | already_AddRefed<Promise> |
39 | | Create(const CredentialCreationOptions& aOptions, ErrorResult& aRv); |
40 | | |
41 | | already_AddRefed<Promise> |
42 | | Store(const Credential& aCredential, ErrorResult& aRv); |
43 | | |
44 | | already_AddRefed<Promise> |
45 | | PreventSilentAccess(ErrorResult& aRv); |
46 | | |
47 | | private: |
48 | | ~CredentialsContainer(); |
49 | | |
50 | | void EnsureWebAuthnManager(); |
51 | | |
52 | | nsCOMPtr<nsPIDOMWindowInner> mParent; |
53 | | RefPtr<WebAuthnManager> mManager; |
54 | | }; |
55 | | |
56 | | } // namespace dom |
57 | | } // namespace mozilla |
58 | | |
59 | | #endif // mozilla_dom_CredentialsContainer_h |