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) { |