mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
script: implement navigator.hardwareConcurrency (#31268)
Signed-off-by: syvb <me@iter.ca>
This commit is contained in:
parent
044b94d5eb
commit
20404a72c0
14 changed files with 32 additions and 40 deletions
|
@ -11,6 +11,7 @@ use crate::dom::bindings::root::{DomRoot, MutNullableDom};
|
|||
use crate::dom::bindings::str::DOMString;
|
||||
use crate::dom::bindings::utils::to_frozen_array;
|
||||
use crate::dom::gpu::GPU;
|
||||
use crate::dom::navigator::hardware_concurrency;
|
||||
use crate::dom::navigatorinfo;
|
||||
use crate::dom::permissions::Permissions;
|
||||
use crate::dom::workerglobalscope::WorkerGlobalScope;
|
||||
|
@ -110,4 +111,9 @@ impl WorkerNavigatorMethods for WorkerNavigator {
|
|||
fn Gpu(&self) -> DomRoot<GPU> {
|
||||
self.gpu.or_init(|| GPU::new(&self.global()))
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-navigator-hardwareconcurrency>
|
||||
fn HardwareConcurrency(&self) -> u64 {
|
||||
hardware_concurrency()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue