Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim:set ts=2 sw=2 sts=2 et cindent: */
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 CredentialsContainer final : public nsISupports
16 : , public nsWrapperCache
17 : {
18 : public:
19 : NS_DECL_CYCLE_COLLECTING_ISUPPORTS
20 0 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CredentialsContainer)
21 :
22 : explicit CredentialsContainer(nsPIDOMWindowInner* aParent);
23 :
24 : nsPIDOMWindowInner*
25 0 : GetParentObject() const
26 : {
27 0 : return mParent;
28 : }
29 :
30 : virtual JSObject*
31 : WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
32 :
33 : already_AddRefed<Promise>
34 : Get(const CredentialRequestOptions& aOptions);
35 : already_AddRefed<Promise>
36 : Create(const CredentialCreationOptions& aOptions);
37 :
38 : private:
39 : ~CredentialsContainer();
40 :
41 : nsCOMPtr<nsPIDOMWindowInner> mParent;
42 : };
43 :
44 : } // namespace dom
45 : } // namespace mozilla
46 :
47 : #endif // mozilla_dom_CredentialsContainer_h
|