Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_SHA_DIGEST_H_ | |
| 6 #define CONTENT_RENDERER_WEBCRYPTO_SHA_DIGEST_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 | |
| 10 #if defined(USE_NSS) | |
| 11 #include <pk11pub.h> | |
| 12 #endif | |
| 13 | |
| 14 #include "third_party/WebKit/public/platform/WebCrypto.h" | |
| 15 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" | |
| 16 | |
| 17 namespace content { | |
| 18 | |
| 19 class WebCryptoSHADigest : public WebKit::WebCryptoOperation { | |
| 20 public: | |
| 21 explicit WebCryptoSHADigest(const WebKit::WebCryptoAlgorithmId algorithm_id, | |
| 22 WebKit::WebCryptoOperationResult* result); | |
| 23 | |
| 24 bool Initialize(); | |
| 25 | |
| 26 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.
| |
| 27 | |
| 28 virtual void abort() OVERRIDE; | |
| 29 | |
| 30 virtual void finish() OVERRIDE; | |
| 31 | |
| 32 private: | |
| 33 virtual ~WebCryptoSHADigest(); | |
| 34 | |
| 35 WebKit::WebCryptoOperationResult* result_; | |
| 36 | |
| 37 #if defined(USE_NSS) | |
| 38 PK11Context* context_; | |
| 39 SECOidTag hash_algorithm_; | |
| 40 #endif | |
| 41 | |
| 42 unsigned int hash_result_length_; | |
| 43 }; | |
| 44 | |
| 45 } // namespace content | |
| 46 | |
| 47 #endif // CONTENT_RENDERER_WEBCRYPTO_SHA_DIGEST_H_ | |
| OLD | NEW |