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

Unified Diff: Source/modules/crypto/SubtleCrypto.cpp

Issue 243853004: [webcrypto] Reject failed operations with a DOMException rather than null. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix compile warning 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
« no previous file with comments | « Source/modules/crypto/NormalizeAlgorithm.cpp ('k') | Source/platform/CryptoResult.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/SubtleCrypto.cpp
diff --git a/Source/modules/crypto/SubtleCrypto.cpp b/Source/modules/crypto/SubtleCrypto.cpp
index 460db6c7e0bf59a82c77a428a8286c5ffea2e683..492bf904befa56a364c5cf855449f1af7d15816b 100644
--- a/Source/modules/crypto/SubtleCrypto.cpp
+++ b/Source/modules/crypto/SubtleCrypto.cpp
@@ -51,7 +51,7 @@ bool ensureNotNull(T* x, const char* paramName, CryptoResult* result)
{
if (!x) {
String message = String("Invalid ") + paramName + String(" argument");
- result->completeWithError(blink::WebString(message));
+ result->completeWithError(blink::WebCryptoErrorTypeType, blink::WebString(message));
return false;
}
return true;
@@ -193,7 +193,7 @@ ScriptPromise SubtleCrypto::exportKey(const String& rawFormat, Key* key)
return promise;
if (!key->extractable()) {
- result->completeWithError("key is not extractable");
+ result->completeWithError(blink::WebCryptoErrorTypeInvalidAccess, "key is not extractable");
return promise;
}
@@ -221,7 +221,7 @@ ScriptPromise SubtleCrypto::wrapKey(const String& rawFormat, Key* key, Key* wrap
return promise;
if (!key->extractable()) {
- result->completeWithError("key is not extractable");
+ result->completeWithError(blink::WebCryptoErrorTypeInvalidAccess, "key is not extractable");
return promise;
}
« no previous file with comments | « Source/modules/crypto/NormalizeAlgorithm.cpp ('k') | Source/platform/CryptoResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698