Skip to content

Push GlobalScope::crypto down into Window and WorkerGlobalScope #44105

@jdm

Description

@jdm

crypto: MutNullableDom<Crypto>,

This field is only used by worker and window globals via

pub(crate) fn crypto(&self, can_gc: CanGc) -> DomRoot<Crypto> {
self.crypto.or_init(|| Crypto::new(self, can_gc))
}
. There's no need to include it in other globals like worklets or debuggers, so let's move the member and initiatlization code to https://github.com/servo/servo/blob/main/components/script/dom/window.rs and https://github.com/servo/servo/blob/main/components/script/dom/workers/workerglobalscope.rs.

Tests: ./mach test-wpt tests/wpt/tests/WebCryptoAPI/getRandomValues.any.js

Metadata

Metadata

Assignees

Labels

A-content/domInteracting with the DOM from web contentC-assignedThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.I-refactorNo impact; the issue is one of maintainability or tidiness. Proposed solution requires refactoring.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions