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

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

Issue 243433006: [webcrypto] Set the error type for failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/child/webcrypto/webcrypto_impl.cc
diff --git a/content/child/webcrypto/webcrypto_impl.cc b/content/child/webcrypto/webcrypto_impl.cc
index cc18630e4a7c402400a9d796c6c9ea4380f06ff7..4de04000ecf262e1731842aa7448e1452d086a8a 100644
--- a/content/child/webcrypto/webcrypto_impl.cc
+++ b/content/child/webcrypto/webcrypto_impl.cc
@@ -21,10 +21,17 @@ namespace {
void CompleteWithError(const Status& status, blink::WebCryptoResult* result) {
DCHECK(status.IsError());
+
+#if defined(WEBCRYPTO_HAS_ERROR_TYPE)
+ result->completeWithError(status.error_type(),
+ blink::WebString::fromUTF8(status.ToString()));
+#else
+ // TODO(eroman): Delete once Blink changes have rolled into Chromium.
if (status.HasErrorDetails())
result->completeWithError(blink::WebString::fromUTF8(status.ToString()));
else
result->completeWithError();
+#endif
}
bool IsAlgorithmAsymmetric(const blink::WebCryptoAlgorithm& algorithm) {
« content/child/webcrypto/platform_crypto_nss.cc ('K') | « content/child/webcrypto/status.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698