Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / dom / webauthn / AuthenticatorAttestationResponse.h
blob024d6bd297c2c49605aee9b048550b8abe644ba0
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_AuthenticatorAttestationResponse_h
8 #define mozilla_dom_AuthenticatorAttestationResponse_h
10 #include "js/TypeDecls.h"
11 #include "mozilla/Attributes.h"
12 #include "mozilla/dom/AuthenticatorResponse.h"
13 #include "mozilla/dom/BindingDeclarations.h"
14 #include "mozilla/dom/CryptoBuffer.h"
15 #include "nsCycleCollectionParticipant.h"
16 #include "nsWrapperCache.h"
18 namespace mozilla::dom {
20 class AuthenticatorAttestationResponse final : public AuthenticatorResponse {
21 public:
22 NS_DECL_ISUPPORTS_INHERITED
23 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
24 AuthenticatorAttestationResponse, AuthenticatorResponse)
26 explicit AuthenticatorAttestationResponse(nsPIDOMWindowInner* aParent);
28 protected:
29 ~AuthenticatorAttestationResponse() override;
31 public:
32 virtual JSObject* WrapObject(JSContext* aCx,
33 JS::Handle<JSObject*> aGivenProto) override;
35 void GetAttestationObject(JSContext* aCx,
36 JS::MutableHandle<JSObject*> aRetVal);
38 nsresult SetAttestationObject(CryptoBuffer& aBuffer);
40 private:
41 CryptoBuffer mAttestationObject;
42 JS::Heap<JSObject*> mAttestationObjectCachedObj;
45 } // namespace mozilla::dom
47 #endif // mozilla_dom_AuthenticatorAttestationResponse_h