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

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: Address comments 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..ad0877106a6226dbb6529a9a9cc8fbf2ac3644de 100644
--- a/content/child/webcrypto/webcrypto_impl.cc
+++ b/content/child/webcrypto/webcrypto_impl.cc
@@ -21,10 +21,18 @@ namespace {
void CompleteWithError(const Status& status, blink::WebCryptoResult* result) {
DCHECK(status.IsError());
- if (status.HasErrorDetails())
- result->completeWithError(blink::WebString::fromUTF8(status.ToString()));
+
+#if defined(WEBCRYPTO_HAS_ERROR_TYPE)
+ result->completeWithError(status.error_type(),
+ blink::WebString::fromUTF8(status.error_details()));
+#else
+ // TODO(eroman): Delete once Blink changes have rolled into Chromium.
+ if (!status.error_details().empty())
+ result->completeWithError(
+ blink::WebString::fromUTF8(status.error_details()));
else
result->completeWithError();
+#endif
}
bool IsAlgorithmAsymmetric(const blink::WebCryptoAlgorithm& algorithm) {
« content/child/webcrypto/shared_crypto_unittest.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