script/dom/webcrypto/
mod.rs1#[cfg(feature = "subtlecrypto")]
6use script_webcrypto::traits::WebCryptoGlobalTrait;
7
8#[cfg(feature = "subtlecrypto")]
9use crate::dom::GlobalScope;
10#[cfg(feature = "subtlecrypto")]
11use crate::tasks::task::TaskOnce;
12
13pub(crate) mod crypto {
14 pub(crate) type Crypto = script_webcrypto::crypto::Crypto<crate::DomTypeHolder>;
15}
16#[cfg(feature = "subtlecrypto")]
17pub(crate) mod cryptokey {
18 pub(crate) type CryptoKey = script_webcrypto::cryptokey::CryptoKey<crate::DomTypeHolder>;
19}
20#[cfg(feature = "subtlecrypto")]
21pub(crate) mod subtlecrypto {
22 pub(crate) type SubtleCrypto =
23 script_webcrypto::subtlecrypto::SubtleCrypto<crate::DomTypeHolder>;
24}
25
26#[cfg(feature = "subtlecrypto")]
27impl WebCryptoGlobalTrait<crate::DomTypeHolder> for GlobalScope {
28 fn queue_crypto_task_source(&self, task: impl TaskOnce + 'static) {
29 self.task_manager().crypto_task_source().queue(task);
30 }
31
32 fn queue_dom_manipulation_task_source(&self, task: impl TaskOnce + 'static) {
33 self.task_manager()
34 .dom_manipulation_task_source()
35 .queue(task);
36 }
37}