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_DIGEST_H_ | |
| 6 #define CONTENT_RENDERER_WEBCRYPTO_DIGEST_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 | |
| 10 #include "third_party/WebKit/public/platform/WebCrypto.h" | |
| 11 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" | |
| 12 | |
| 13 #if defined(USE_NSS) | |
| 14 typedef struct HASHContextStr HASHContext; | |
| 15 #endif | |
| 16 | |
| 17 namespace content { | |
| 18 | |
| 19 class WebCryptoDigest : public WebKit::WebCryptoOperation { | |
| 20 public: | |
| 21 explicit WebCryptoDigest(const WebKit::WebCryptoOperationResult& result); | |
| 22 virtual ~WebCryptoDigest(); | |
| 23 | |
| 24 bool Initialize(const WebKit::WebCryptoAlgorithm& algorithm); | |
| 25 | |
| 26 // Feeds data to the digest operation. | |
| 27 // - |bytes| may be 0 if |size| is 0 | |
| 28 // - |bytes| is valid only until process() returns | |
| 29 // - process() will not be called after abort() or finish() | |
| 30 virtual void process(const unsigned char* bytes, size_t size); | |
|
jamesr
2013/08/09 20:04:55
add a documenting what these override. for example
Bryan Eyler
2013/08/13 18:22:21
Done.
| |
| 31 // Cancels the in-process digest operation. | |
| 32 virtual void abort(); | |
| 33 // Indicates that there is no more data to receive. | |
| 34 virtual void finish(); | |
| 35 | |
| 36 private: | |
| 37 WebKit::WebCryptoOperationResult result_; | |
| 38 | |
| 39 #if defined(USE_NSS) | |
| 40 HASHContext* context_; | |
| 41 #endif | |
| 42 }; | |
| 43 | |
| 44 } // namespace content | |
| 45 | |
| 46 #endif // CONTENT_RENDERER_WEBCRYPTO_DIGEST_H_ | |
| OLD | NEW |