| Index: content/renderer/webcrypto_sha_digest.h
|
| diff --git a/content/renderer/webcrypto_sha_digest.h b/content/renderer/webcrypto_sha_digest.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..01309bf22635ce6b6c0545eb9403387afa28eb5f
|
| --- /dev/null
|
| +++ b/content/renderer/webcrypto_sha_digest.h
|
| @@ -0,0 +1,42 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CONTENT_RENDERER_WEBCRYPTO_SHA_DIGEST_H_
|
| +#define CONTENT_RENDERER_WEBCRYPTO_SHA_DIGEST_H_
|
| +
|
| +#include "base/compiler_specific.h"
|
| +
|
| +#include "third_party/WebKit/public/platform/WebCrypto.h"
|
| +#include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h"
|
| +
|
| +#if defined(USE_NSS)
|
| +typedef struct HASHContextStr HASHContext;
|
| +#endif
|
| +
|
| +namespace content {
|
| +
|
| +class WebCryptoSHADigest : public WebKit::WebCryptoOperation {
|
| + public:
|
| + explicit WebCryptoSHADigest(WebKit::WebCryptoOperationResult& result);
|
| + virtual ~WebCryptoSHADigest();
|
| +
|
| + bool Initialize(const WebKit::WebCryptoAlgorithm& algorithm);
|
| +
|
| + virtual void process(const unsigned char* bytes, size_t size) OVERRIDE;
|
| + virtual void abort() OVERRIDE;
|
| + virtual void finish() OVERRIDE;
|
| +
|
| + private:
|
| + WebKit::WebCryptoOperationResult result_;
|
| +
|
| +#if defined(USE_NSS)
|
| + HASHContext* context_;
|
| +#endif
|
| +
|
| + unsigned int hash_result_length_;
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_RENDERER_WEBCRYPTO_SHA_DIGEST_H_
|
|
|