mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Cleanups for future script crate split (#35987)
* script: Avoid direct impl blocks on generated dicts and unions. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Remove references to codegen-specific import module. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix tidy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
3ecd1c0699
commit
d35da38a2f
43 changed files with 211 additions and 146 deletions
|
@ -38,7 +38,6 @@ use crate::dom::bindings::codegen::UnionTypes::{
|
|||
ArrayBufferViewOrArrayBuffer, ArrayBufferViewOrArrayBufferOrJsonWebKey,
|
||||
};
|
||||
use crate::dom::bindings::error::{Error, Fallible};
|
||||
use crate::dom::bindings::import::module::SafeJSContext;
|
||||
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
||||
use crate::dom::bindings::reflector::{DomGlobal, Reflector, reflect_dom_object};
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
|
@ -258,7 +257,7 @@ impl SubtleCryptoMethods<crate::DomTypeHolder> for SubtleCrypto {
|
|||
/// <https://w3c.github.io/webcrypto/#SubtleCrypto-method-sign>
|
||||
fn Sign(
|
||||
&self,
|
||||
cx: SafeJSContext,
|
||||
cx: JSContext,
|
||||
algorithm: AlgorithmIdentifier,
|
||||
key: &CryptoKey,
|
||||
data: ArrayBufferViewOrArrayBuffer,
|
||||
|
@ -341,7 +340,7 @@ impl SubtleCryptoMethods<crate::DomTypeHolder> for SubtleCrypto {
|
|||
/// <https://w3c.github.io/webcrypto/#SubtleCrypto-method-verify>
|
||||
fn Verify(
|
||||
&self,
|
||||
cx: SafeJSContext,
|
||||
cx: JSContext,
|
||||
algorithm: AlgorithmIdentifier,
|
||||
key: &CryptoKey,
|
||||
signature: ArrayBufferViewOrArrayBuffer,
|
||||
|
@ -429,7 +428,7 @@ impl SubtleCryptoMethods<crate::DomTypeHolder> for SubtleCrypto {
|
|||
/// <https://w3c.github.io/webcrypto/#SubtleCrypto-method-digest>
|
||||
fn Digest(
|
||||
&self,
|
||||
cx: SafeJSContext,
|
||||
cx: JSContext,
|
||||
algorithm: AlgorithmIdentifier,
|
||||
data: ArrayBufferViewOrArrayBuffer,
|
||||
comp: InRealm,
|
||||
|
@ -533,7 +532,7 @@ impl SubtleCryptoMethods<crate::DomTypeHolder> for SubtleCrypto {
|
|||
/// <https://w3c.github.io/webcrypto/#SubtleCrypto-method-deriveKey>
|
||||
fn DeriveKey(
|
||||
&self,
|
||||
cx: SafeJSContext,
|
||||
cx: JSContext,
|
||||
algorithm: AlgorithmIdentifier,
|
||||
base_key: &CryptoKey,
|
||||
derived_key_type: AlgorithmIdentifier,
|
||||
|
@ -663,7 +662,7 @@ impl SubtleCryptoMethods<crate::DomTypeHolder> for SubtleCrypto {
|
|||
/// <https://w3c.github.io/webcrypto/#dfn-SubtleCrypto-method-deriveBits>
|
||||
fn DeriveBits(
|
||||
&self,
|
||||
cx: SafeJSContext,
|
||||
cx: JSContext,
|
||||
algorithm: AlgorithmIdentifier,
|
||||
base_key: &CryptoKey,
|
||||
length: Option<u32>,
|
||||
|
@ -2631,7 +2630,11 @@ fn data_to_jwk_params(alg: &str, size: &str, key: &[u8]) -> (DOMString, DOMStrin
|
|||
(jwk_alg, DOMString::from(data))
|
||||
}
|
||||
|
||||
impl KeyAlgorithm {
|
||||
trait AlgorithmFromName {
|
||||
fn from_name(name: DOMString, out: MutableHandleObject, cx: JSContext);
|
||||
}
|
||||
|
||||
impl AlgorithmFromName for KeyAlgorithm {
|
||||
/// Fill the object referenced by `out` with an [KeyAlgorithm]
|
||||
/// of the specified name and size.
|
||||
#[allow(unsafe_code)]
|
||||
|
@ -2644,7 +2647,16 @@ impl KeyAlgorithm {
|
|||
}
|
||||
}
|
||||
|
||||
impl HmacKeyAlgorithm {
|
||||
trait AlgorithmFromLengthAndHash {
|
||||
fn from_length_and_hash(
|
||||
length: u32,
|
||||
hash: DigestAlgorithm,
|
||||
out: MutableHandleObject,
|
||||
cx: JSContext,
|
||||
);
|
||||
}
|
||||
|
||||
impl AlgorithmFromLengthAndHash for HmacKeyAlgorithm {
|
||||
#[allow(unsafe_code)]
|
||||
fn from_length_and_hash(
|
||||
length: u32,
|
||||
|
@ -2666,7 +2678,11 @@ impl HmacKeyAlgorithm {
|
|||
}
|
||||
}
|
||||
|
||||
impl AesKeyAlgorithm {
|
||||
trait AlgorithmFromNameAndSize {
|
||||
fn from_name_and_size(name: DOMString, size: u16, out: MutableHandleObject, cx: JSContext);
|
||||
}
|
||||
|
||||
impl AlgorithmFromNameAndSize for AesKeyAlgorithm {
|
||||
/// Fill the object referenced by `out` with an [AesKeyAlgorithm]
|
||||
/// of the specified name and size.
|
||||
#[allow(unsafe_code)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue