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..7436c946e2075e08f327bc2fad1345ceabe7ef4a |
--- /dev/null |
+++ b/content/renderer/webcrypto_sha_digest.h |
@@ -0,0 +1,47 @@ |
+// 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" |
+ |
+#if defined(USE_NSS) |
+#include <pk11pub.h> |
+#endif |
+ |
+#include "third_party/WebKit/public/platform/WebCrypto.h" |
+#include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" |
+ |
+namespace content { |
+ |
+class WebCryptoSHADigest : public WebKit::WebCryptoOperation { |
+ public: |
+ explicit WebCryptoSHADigest(const WebKit::WebCryptoAlgorithmId algorithm_id, |
+ WebKit::WebCryptoOperationResult* result); |
+ |
+ bool Initialize(); |
+ |
+ virtual void process(const unsigned char* bytes, size_t size) OVERRIDE; |
eroman
2013/07/24 01:33:50
nit: I would remove the newlines between process/a
Bryan Eyler
2013/07/31 00:28:44
Done.
|
+ |
+ virtual void abort() OVERRIDE; |
+ |
+ virtual void finish() OVERRIDE; |
+ |
+ private: |
+ virtual ~WebCryptoSHADigest(); |
+ |
+ WebKit::WebCryptoOperationResult* result_; |
+ |
+#if defined(USE_NSS) |
+ PK11Context* context_; |
+ SECOidTag hash_algorithm_; |
+#endif |
+ |
+ unsigned int hash_result_length_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_WEBCRYPTO_SHA_DIGEST_H_ |