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

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

Issue 72363002: Rename es => exceptionState in other than bindings/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Retry Created 7 years, 1 month 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/modules/encoding/TextDecoder.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 8c4018e6e48ddd3b58c296ef61d08b71a2dd0675..4f00316f9ad93706be7e49db077cf7e23b9e0c4d 100644
--- a/Source/modules/crypto/SubtleCrypto.cpp
+++ b/Source/modules/crypto/SubtleCrypto.cpp
@@ -49,30 +49,30 @@ namespace WebCore {
namespace {
-ScriptPromise startCryptoOperation(const Dictionary& rawAlgorithm, Key* key, AlgorithmOperation operationType, ArrayBufferView* signature, ArrayBufferView* dataBuffer, ExceptionState& es)
+ScriptPromise startCryptoOperation(const Dictionary& rawAlgorithm, Key* key, AlgorithmOperation operationType, ArrayBufferView* signature, ArrayBufferView* dataBuffer, ExceptionState& exceptionState)
{
bool requiresKey = operationType != Digest;
// Seems like the generated bindings should take care of these however it
// currently doesn't. See also http://crbugh.com/264520
if (requiresKey && !key) {
- es.throwTypeError("Invalid key argument");
+ exceptionState.throwTypeError("Invalid key argument");
return ScriptPromise();
}
if (operationType == Verify && !signature) {
- es.throwTypeError("Invalid signature argument");
+ exceptionState.throwTypeError("Invalid signature argument");
return ScriptPromise();
}
if (!dataBuffer) {
- es.throwTypeError("Invalid dataBuffer argument");
+ exceptionState.throwTypeError("Invalid dataBuffer argument");
return ScriptPromise();
}
blink::WebCryptoAlgorithm algorithm;
- if (!normalizeAlgorithm(rawAlgorithm, operationType, algorithm, es))
+ if (!normalizeAlgorithm(rawAlgorithm, operationType, algorithm, exceptionState))
return ScriptPromise();
- if (requiresKey && !key->canBeUsedForAlgorithm(algorithm, operationType, es))
+ if (requiresKey && !key->canBeUsedForAlgorithm(algorithm, operationType, exceptionState))
return ScriptPromise();
const unsigned char* data = static_cast<const unsigned char*>(dataBuffer->baseAddress());
@@ -112,39 +112,39 @@ SubtleCrypto::SubtleCrypto()
ScriptWrappable::init(this);
}
-ScriptPromise SubtleCrypto::encrypt(const Dictionary& rawAlgorithm, Key* key, ArrayBufferView* data, ExceptionState& es)
+ScriptPromise SubtleCrypto::encrypt(const Dictionary& rawAlgorithm, Key* key, ArrayBufferView* data, ExceptionState& exceptionState)
{
- return startCryptoOperation(rawAlgorithm, key, Encrypt, 0, data, es);
+ return startCryptoOperation(rawAlgorithm, key, Encrypt, 0, data, exceptionState);
}
-ScriptPromise SubtleCrypto::decrypt(const Dictionary& rawAlgorithm, Key* key, ArrayBufferView* data, ExceptionState& es)
+ScriptPromise SubtleCrypto::decrypt(const Dictionary& rawAlgorithm, Key* key, ArrayBufferView* data, ExceptionState& exceptionState)
{
- return startCryptoOperation(rawAlgorithm, key, Decrypt, 0, data, es);
+ return startCryptoOperation(rawAlgorithm, key, Decrypt, 0, data, exceptionState);
}
-ScriptPromise SubtleCrypto::sign(const Dictionary& rawAlgorithm, Key* key, ArrayBufferView* data, ExceptionState& es)
+ScriptPromise SubtleCrypto::sign(const Dictionary& rawAlgorithm, Key* key, ArrayBufferView* data, ExceptionState& exceptionState)
{
- return startCryptoOperation(rawAlgorithm, key, Sign, 0, data, es);
+ return startCryptoOperation(rawAlgorithm, key, Sign, 0, data, exceptionState);
}
-ScriptPromise SubtleCrypto::verifySignature(const Dictionary& rawAlgorithm, Key* key, ArrayBufferView* signature, ArrayBufferView* data, ExceptionState& es)
+ScriptPromise SubtleCrypto::verifySignature(const Dictionary& rawAlgorithm, Key* key, ArrayBufferView* signature, ArrayBufferView* data, ExceptionState& exceptionState)
{
- return startCryptoOperation(rawAlgorithm, key, Verify, signature, data, es);
+ return startCryptoOperation(rawAlgorithm, key, Verify, signature, data, exceptionState);
}
-ScriptPromise SubtleCrypto::digest(const Dictionary& rawAlgorithm, ArrayBufferView* data, ExceptionState& es)
+ScriptPromise SubtleCrypto::digest(const Dictionary& rawAlgorithm, ArrayBufferView* data, ExceptionState& exceptionState)
{
- return startCryptoOperation(rawAlgorithm, 0, Digest, 0, data, es);
+ return startCryptoOperation(rawAlgorithm, 0, Digest, 0, data, exceptionState);
}
-ScriptPromise SubtleCrypto::generateKey(const Dictionary& rawAlgorithm, bool extractable, const Vector<String>& rawKeyUsages, ExceptionState& es)
+ScriptPromise SubtleCrypto::generateKey(const Dictionary& rawAlgorithm, bool extractable, const Vector<String>& rawKeyUsages, ExceptionState& exceptionState)
{
blink::WebCryptoKeyUsageMask keyUsages;
- if (!Key::parseUsageMask(rawKeyUsages, keyUsages, es))
+ if (!Key::parseUsageMask(rawKeyUsages, keyUsages, exceptionState))
return ScriptPromise();
blink::WebCryptoAlgorithm algorithm;
- if (!normalizeAlgorithm(rawAlgorithm, GenerateKey, algorithm, es))
+ if (!normalizeAlgorithm(rawAlgorithm, GenerateKey, algorithm, exceptionState))
return ScriptPromise();
ScriptPromise promise = ScriptPromise::createPending();
@@ -153,24 +153,24 @@ ScriptPromise SubtleCrypto::generateKey(const Dictionary& rawAlgorithm, bool ext
return promise;
}
-ScriptPromise SubtleCrypto::importKey(const String& rawFormat, ArrayBufferView* keyData, const Dictionary& rawAlgorithm, bool extractable, const Vector<String>& rawKeyUsages, ExceptionState& es)
+ScriptPromise SubtleCrypto::importKey(const String& rawFormat, ArrayBufferView* keyData, const Dictionary& rawAlgorithm, bool extractable, const Vector<String>& rawKeyUsages, ExceptionState& exceptionState)
{
blink::WebCryptoKeyFormat format;
- if (!Key::parseFormat(rawFormat, format, es))
+ if (!Key::parseFormat(rawFormat, format, exceptionState))
return ScriptPromise();
if (!keyData) {
- es.throwTypeError("Invalid keyData argument");
+ exceptionState.throwTypeError("Invalid keyData argument");
return ScriptPromise();
}
blink::WebCryptoKeyUsageMask keyUsages;
- if (!Key::parseUsageMask(rawKeyUsages, keyUsages, es))
+ if (!Key::parseUsageMask(rawKeyUsages, keyUsages, exceptionState))
return ScriptPromise();
// The algorithm is optional.
blink::WebCryptoAlgorithm algorithm;
- if (!rawAlgorithm.isUndefinedOrNull() && !normalizeAlgorithm(rawAlgorithm, ImportKey, algorithm, es))
+ if (!rawAlgorithm.isUndefinedOrNull() && !normalizeAlgorithm(rawAlgorithm, ImportKey, algorithm, exceptionState))
return ScriptPromise();
const unsigned char* keyDataBytes = static_cast<unsigned char*>(keyData->baseAddress());
@@ -181,19 +181,19 @@ ScriptPromise SubtleCrypto::importKey(const String& rawFormat, ArrayBufferView*
return promise;
}
-ScriptPromise SubtleCrypto::exportKey(const String& rawFormat, Key* key, ExceptionState& es)
+ScriptPromise SubtleCrypto::exportKey(const String& rawFormat, Key* key, ExceptionState& exceptionState)
{
blink::WebCryptoKeyFormat format;
- if (!Key::parseFormat(rawFormat, format, es))
+ if (!Key::parseFormat(rawFormat, format, exceptionState))
return ScriptPromise();
if (!key) {
- es.throwTypeError("Invalid key argument");
+ exceptionState.throwTypeError("Invalid key argument");
return ScriptPromise();
}
if (!key->extractable()) {
- es.throwDOMException(NotSupportedError, "key is not extractable");
+ exceptionState.throwDOMException(NotSupportedError, "key is not extractable");
return ScriptPromise();
}
« no previous file with comments | « Source/modules/crypto/NormalizeAlgorithm.cpp ('k') | Source/modules/encoding/TextDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698