michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef nsEntropyCollector_h___ michael@0: #define nsEntropyCollector_h___ michael@0: michael@0: #include "nsIEntropyCollector.h" michael@0: #include "nsIBufEntropyCollector.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: #define NS_ENTROPYCOLLECTOR_CID \ michael@0: { /* 34587f4a-be18-43c0-9112-b782b08c0add */ \ michael@0: 0x34587f4a, 0xbe18, 0x43c0, \ michael@0: {0x91, 0x12, 0xb7, 0x82, 0xb0, 0x8c, 0x0a, 0xdd} } michael@0: michael@0: class nsEntropyCollector : public nsIBufEntropyCollector michael@0: { michael@0: public: michael@0: nsEntropyCollector(); michael@0: virtual ~nsEntropyCollector(); michael@0: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSIENTROPYCOLLECTOR michael@0: NS_DECL_NSIBUFENTROPYCOLLECTOR michael@0: michael@0: enum { entropy_buffer_size = 1024 }; michael@0: michael@0: protected: michael@0: unsigned char mEntropyCache[entropy_buffer_size]; michael@0: int32_t mBytesCollected; michael@0: unsigned char *mWritePointer; michael@0: nsCOMPtr mForwardTarget; michael@0: }; michael@0: michael@0: #endif /* !defined nsEntropyCollector_h__ */