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 : #include "mozilla/dom/WebAuthenticationBinding.h"
8 : #include "mozilla/dom/AuthenticatorAttestationResponse.h"
9 :
10 : namespace mozilla {
11 : namespace dom {
12 :
13 0 : NS_IMPL_ADDREF_INHERITED(AuthenticatorAttestationResponse, AuthenticatorResponse)
14 0 : NS_IMPL_RELEASE_INHERITED(AuthenticatorAttestationResponse, AuthenticatorResponse)
15 :
16 0 : NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(AuthenticatorAttestationResponse)
17 0 : NS_INTERFACE_MAP_END_INHERITING(AuthenticatorResponse)
18 :
19 0 : AuthenticatorAttestationResponse::AuthenticatorAttestationResponse(nsPIDOMWindowInner* aParent)
20 0 : : AuthenticatorResponse(aParent)
21 0 : {}
22 :
23 0 : AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse()
24 0 : {}
25 :
26 : JSObject*
27 0 : AuthenticatorAttestationResponse::WrapObject(JSContext* aCx,
28 : JS::Handle<JSObject*> aGivenProto)
29 : {
30 0 : return AuthenticatorAttestationResponseBinding::Wrap(aCx, this, aGivenProto);
31 : }
32 :
33 : void
34 0 : AuthenticatorAttestationResponse::GetAttestationObject(JSContext* aCx,
35 : JS::MutableHandle<JSObject*> aRetVal) const
36 : {
37 0 : aRetVal.set(mAttestationObject.ToUint8Array(aCx));
38 0 : }
39 :
40 : nsresult
41 0 : AuthenticatorAttestationResponse::SetAttestationObject(CryptoBuffer& aBuffer)
42 : {
43 0 : if (NS_WARN_IF(!mAttestationObject.Assign(aBuffer))) {
44 0 : return NS_ERROR_OUT_OF_MEMORY;
45 : }
46 0 : return NS_OK;
47 : }
48 :
49 : } // namespace dom
50 : } // namespace mozilla
|