Index: third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp |
diff --git a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp |
index d45a653c3cf2f4e6deb9cedf636d0bc4662a6750..64c4e5eb4c63423ca778b64e9feacdc8293aa944 100644 |
--- a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp |
+++ b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp |
@@ -61,15 +61,16 @@ |
static bool CanAccessWebCrypto(ScriptState* script_state, |
CryptoResult* result) { |
String error_message; |
- if (!script_state->GetExecutionContext()->IsSecureContext( |
- error_message, ExecutionContext::kWebCryptoSecureContextCheck)) { |
+ if (!ExecutionContext::From(script_state) |
+ ->IsSecureContext(error_message, |
+ ExecutionContext::kWebCryptoSecureContextCheck)) { |
result->CompleteWithError(kWebCryptoErrorTypeNotSupported, error_message); |
return false; |
} |
- if (!script_state->GetExecutionContext()->IsSecureContext()) { |
+ if (!ExecutionContext::From(script_state)->IsSecureContext()) { |
Deprecation::CountDeprecation( |
- script_state->GetExecutionContext(), |
+ ExecutionContext::From(script_state), |
UseCounter::kSubtleCryptoOnlyStrictSecureContextCheckFailed); |
} |
@@ -213,7 +214,7 @@ |
kWebCryptoKeyUsageEncrypt, result)) |
return promise; |
- HistogramAlgorithmAndKey(script_state->GetExecutionContext(), |
+ HistogramAlgorithmAndKey(ExecutionContext::From(script_state), |
normalized_algorithm, key->Key()); |
Platform::Current()->Crypto()->Encrypt(normalized_algorithm, key->Key(), |
std::move(data), result->Result()); |
@@ -254,7 +255,7 @@ |
kWebCryptoKeyUsageDecrypt, result)) |
return promise; |
- HistogramAlgorithmAndKey(script_state->GetExecutionContext(), |
+ HistogramAlgorithmAndKey(ExecutionContext::From(script_state), |
normalized_algorithm, key->Key()); |
Platform::Current()->Crypto()->Decrypt(normalized_algorithm, key->Key(), |
std::move(data), result->Result()); |
@@ -295,7 +296,7 @@ |
result)) |
return promise; |
- HistogramAlgorithmAndKey(script_state->GetExecutionContext(), |
+ HistogramAlgorithmAndKey(ExecutionContext::From(script_state), |
normalized_algorithm, key->Key()); |
Platform::Current()->Crypto()->Sign(normalized_algorithm, key->Key(), |
std::move(data), result->Result()); |
@@ -342,7 +343,7 @@ |
kWebCryptoKeyUsageVerify, result)) |
return promise; |
- HistogramAlgorithmAndKey(script_state->GetExecutionContext(), |
+ HistogramAlgorithmAndKey(ExecutionContext::From(script_state), |
normalized_algorithm, key->Key()); |
Platform::Current()->Crypto()->VerifySignature( |
normalized_algorithm, key->Key(), std::move(signature), std::move(data), |
@@ -373,7 +374,8 @@ |
normalized_algorithm, result)) |
return promise; |
- HistogramAlgorithm(script_state->GetExecutionContext(), normalized_algorithm); |
+ HistogramAlgorithm(ExecutionContext::From(script_state), |
+ normalized_algorithm); |
Platform::Current()->Crypto()->Digest(normalized_algorithm, std::move(data), |
result->Result()); |
return promise; |
@@ -409,7 +411,8 @@ |
// keys. This normative requirement is enforced by the platform |
// implementation in the call below. |
- HistogramAlgorithm(script_state->GetExecutionContext(), normalized_algorithm); |
+ HistogramAlgorithm(ExecutionContext::From(script_state), |
+ normalized_algorithm); |
Platform::Current()->Crypto()->GenerateKey(normalized_algorithm, extractable, |
key_usages, result->Result()); |
return promise; |
@@ -495,7 +498,8 @@ |
normalized_algorithm, result)) |
return promise; |
- HistogramAlgorithm(script_state->GetExecutionContext(), normalized_algorithm); |
+ HistogramAlgorithm(ExecutionContext::From(script_state), |
+ normalized_algorithm); |
Platform::Current()->Crypto()->ImportKey(format, std::move(key_data), |
normalized_algorithm, extractable, |
key_usages, result->Result()); |
@@ -526,7 +530,7 @@ |
return promise; |
} |
- HistogramKey(script_state->GetExecutionContext(), key->Key()); |
+ HistogramKey(ExecutionContext::From(script_state), key->Key()); |
Platform::Current()->Crypto()->ExportKey(format, key->Key(), |
result->Result()); |
return promise; |
@@ -585,9 +589,9 @@ |
return promise; |
} |
- HistogramAlgorithmAndKey(script_state->GetExecutionContext(), |
+ HistogramAlgorithmAndKey(ExecutionContext::From(script_state), |
normalized_algorithm, wrapping_key->Key()); |
- HistogramKey(script_state->GetExecutionContext(), key->Key()); |
+ HistogramKey(ExecutionContext::From(script_state), key->Key()); |
Platform::Current()->Crypto()->WrapKey( |
format, key->Key(), wrapping_key->Key(), normalized_algorithm, |
result->Result()); |
@@ -660,9 +664,9 @@ |
// normative requirement is enforced by the platform implementation in the |
// call below. |
- HistogramAlgorithmAndKey(script_state->GetExecutionContext(), |
+ HistogramAlgorithmAndKey(ExecutionContext::From(script_state), |
normalized_algorithm, unwrapping_key->Key()); |
- HistogramAlgorithm(script_state->GetExecutionContext(), |
+ HistogramAlgorithm(ExecutionContext::From(script_state), |
normalized_key_algorithm); |
Platform::Current()->Crypto()->UnwrapKey( |
format, std::move(wrapped_key), unwrapping_key->Key(), |
@@ -702,7 +706,7 @@ |
kWebCryptoKeyUsageDeriveBits, result)) |
return promise; |
- HistogramAlgorithmAndKey(script_state->GetExecutionContext(), |
+ HistogramAlgorithmAndKey(ExecutionContext::From(script_state), |
normalized_algorithm, base_key->Key()); |
Platform::Current()->Crypto()->DeriveBits( |
normalized_algorithm, base_key->Key(), length_bits, result->Result()); |
@@ -772,9 +776,9 @@ |
// normative requirement is enforced by the platform implementation in the |
// call below. |
- HistogramAlgorithmAndKey(script_state->GetExecutionContext(), |
+ HistogramAlgorithmAndKey(ExecutionContext::From(script_state), |
normalized_algorithm, base_key->Key()); |
- HistogramAlgorithm(script_state->GetExecutionContext(), |
+ HistogramAlgorithm(ExecutionContext::From(script_state), |
normalized_derived_key_algorithm); |
Platform::Current()->Crypto()->DeriveKey( |
normalized_algorithm, base_key->Key(), normalized_derived_key_algorithm, |