Index: content/renderer/webcrypto_digest.h |
diff --git a/content/renderer/webcrypto_digest.h b/content/renderer/webcrypto_digest.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a174112202a54ef344976e56ececa5106edf6604 |
--- /dev/null |
+++ b/content/renderer/webcrypto_digest.h |
@@ -0,0 +1,40 @@ |
+// 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_DIGEST_H_ |
+#define CONTENT_RENDERER_WEBCRYPTO_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 WebCryptoDigest : public WebKit::WebCryptoOperation { |
+ public: |
+ explicit WebCryptoDigest(const WebKit::WebCryptoOperationResult& result); |
+ virtual ~WebCryptoDigest(); |
+ |
+ bool Initialize(const WebKit::WebCryptoAlgorithm& algorithm); |
+ |
+ virtual void process(const unsigned char* bytes, size_t size) OVERRIDE; |
jamesr
2013/08/07 23:25:31
document what interface these are overriding
if t
|
+ virtual void abort() OVERRIDE; |
+ virtual void finish() OVERRIDE; |
+ |
+ private: |
+ WebKit::WebCryptoOperationResult result_; |
+ |
+#if defined(USE_NSS) |
+ HASHContext* context_; |
+#endif |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_WEBCRYPTO_DIGEST_H_ |