tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

CredentialsContainer.h (1777B)


      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::dom {
     13 
     14 class WebAuthnHandler;
     15 
     16 class CredentialsContainer final : public nsISupports, public nsWrapperCache {
     17 public:
     18  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     19  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CredentialsContainer)
     20 
     21  explicit CredentialsContainer(nsPIDOMWindowInner* aParent);
     22 
     23  nsPIDOMWindowInner* GetParentObject() const { return mParent; }
     24 
     25  already_AddRefed<WebAuthnHandler> GetWebAuthnHandler();
     26 
     27  virtual JSObject* WrapObject(JSContext* aCx,
     28                               JS::Handle<JSObject*> aGivenProto) override;
     29 
     30  already_AddRefed<Promise> Get(const CredentialRequestOptions& aOptions,
     31                                ErrorResult& aRv);
     32 
     33  already_AddRefed<Promise> Create(const CredentialCreationOptions& aOptions,
     34                                   ErrorResult& aRv);
     35 
     36  already_AddRefed<Promise> Store(const Credential& aCredential,
     37                                  ErrorResult& aRv);
     38 
     39  already_AddRefed<Promise> PreventSilentAccess(ErrorResult& aRv);
     40 
     41  static bool IsSameOriginWithAncestors(nsPIDOMWindowInner* aParent);
     42 
     43 private:
     44  ~CredentialsContainer();
     45 
     46  void EnsureWebAuthnHandler();
     47 
     48  nsCOMPtr<nsPIDOMWindowInner> mParent;
     49  RefPtr<WebAuthnHandler> mWebAuthnHandler;
     50 };
     51 
     52 }  // namespace mozilla::dom
     53 
     54 #endif  // mozilla_dom_CredentialsContainer_h