Index: content/renderer/webcrypto/webcrypto_impl.cc |
diff --git a/content/renderer/webcrypto/webcrypto_impl.cc b/content/renderer/webcrypto/webcrypto_impl.cc |
index 4cb77d58bea9024b63a25c23465ba2ce631f7bc7..65c42b40f6e524a3895badd1a04f5cf343806a93 100644 |
--- a/content/renderer/webcrypto/webcrypto_impl.cc |
+++ b/content/renderer/webcrypto/webcrypto_impl.cc |
@@ -194,4 +194,20 @@ void WebCryptoImpl::verifySignature(const blink::WebCryptoAlgorithm& algorithm, |
result.completeWithBoolean(signature_match); |
} |
+// This method synchronously computes a digest for the given data, returning |
eroman
2014/02/21 23:11:20
Can you move this comment to the header file?
jww
2014/02/21 23:23:34
Done.
|
+// |true| if successful and |false| otherwise. This relies on the |
+// webcrypto::Digest() implementation being synchronous as well, so if that ever |
eroman
2014/02/21 23:11:20
Please remove this comment, I think the function s
jww
2014/02/21 23:23:34
Done.
|
+// changes, this method will also need to be modified. |
+bool WebCryptoImpl::digestSynchronous( |
+ const blink::WebCryptoAlgorithmId algorithm_id, |
eroman
2014/02/21 23:11:20
in the header this is called "algorithm". Please u
jww
2014/02/21 23:23:34
Done.
|
+ const unsigned char* data, |
+ unsigned int data_size, |
+ blink::WebArrayBuffer& result) { |
eroman
2014/02/21 23:11:20
did you run "git cl format". If not please do, try
jww
2014/02/21 23:23:34
Yup, I ran git-cl format over this. In fact, the w
|
+ blink::WebCryptoAlgorithm algorithm = |
+ blink::WebCryptoAlgorithm::adoptParamsAndCreate(algorithm_id, NULL); |
+ return (webcrypto::Digest( |
+ algorithm, webcrypto::CryptoData(data, data_size), &result)) |
+ .IsSuccess(); |
+} |
+ |
} // namespace content |