Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: content/renderer/webcrypto/webcrypto_impl.cc

Issue 138343008: Add content implementation of digestSynchcronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« content/renderer/webcrypto/webcrypto_impl.h ('K') | « content/renderer/webcrypto/webcrypto_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698