LCOV - code coverage report
Current view: top level - dom/crypto - CryptoBuffer.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 4 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 5 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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_CryptoBuffer_h
       8             : #define mozilla_dom_CryptoBuffer_h
       9             : 
      10             : #include "nsTArray.h"
      11             : #include "seccomon.h"
      12             : #include "mozilla/dom/TypedArray.h"
      13             : 
      14             : namespace mozilla {
      15             : namespace dom {
      16             : 
      17             : class ArrayBufferViewOrArrayBuffer;
      18             : class OwningArrayBufferViewOrArrayBuffer;
      19             : 
      20           0 : class CryptoBuffer : public FallibleTArray<uint8_t>
      21             : {
      22             : public:
      23             :   uint8_t* Assign(const CryptoBuffer& aData);
      24             :   uint8_t* Assign(const uint8_t* aData, uint32_t aLength);
      25             :   uint8_t* Assign(const nsACString& aString);
      26             :   uint8_t* Assign(const SECItem* aItem);
      27             :   uint8_t* Assign(const InfallibleTArray<uint8_t>& aData);
      28             :   uint8_t* Assign(const ArrayBuffer& aData);
      29             :   uint8_t* Assign(const ArrayBufferView& aData);
      30             :   uint8_t* Assign(const ArrayBufferViewOrArrayBuffer& aData);
      31             :   uint8_t* Assign(const OwningArrayBufferViewOrArrayBuffer& aData);
      32             : 
      33             :   uint8_t* AppendSECItem(const SECItem* aItem);
      34             :   uint8_t* AppendSECItem(const SECItem& aItem);
      35             : 
      36             :   template<typename T,
      37             :            JSObject* UnwrapArray(JSObject*),
      38             :            void GetLengthAndDataAndSharedness(JSObject*, uint32_t*, bool*, T**)>
      39           0 :   uint8_t* Assign(const TypedArray_base<T, UnwrapArray,
      40             :                                         GetLengthAndDataAndSharedness>& aArray)
      41             :   {
      42           0 :     aArray.ComputeLengthAndData();
      43           0 :     return Assign(aArray.Data(), aArray.Length());
      44             :   }
      45             : 
      46             :   nsresult FromJwkBase64(const nsString& aBase64);
      47             :   nsresult ToJwkBase64(nsString& aBase64) const;
      48             :   bool ToSECItem(PLArenaPool* aArena, SECItem* aItem) const;
      49             :   JSObject* ToUint8Array(JSContext* aCx) const;
      50             :   bool ToNewUnsignedBuffer(uint8_t** aBuf, uint32_t* aBufLen) const;
      51             : 
      52             :   bool GetBigIntValue(unsigned long& aRetVal);
      53             : };
      54             : 
      55             : } // namespace dom
      56             : } // namespace mozilla
      57             : 
      58             : #endif // mozilla_dom_CryptoBuffer_h

Generated by: LCOV version 1.13