mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibWeb: Fill out implementation for navigator.hardwareConcurrency
Instead of always reporting 1 :^)
This commit is contained in:
committed by
Andreas Kling
parent
9c9a378455
commit
f186e7e537
@@ -1,11 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
|
* Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
|
||||||
|
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <LibCore/System.h>
|
||||||
#include <LibWeb/WebIDL/Types.h>
|
#include <LibWeb/WebIDL/Types.h>
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
@@ -13,7 +15,7 @@ namespace Web::HTML {
|
|||||||
class NavigatorConcurrentHardwareMixin {
|
class NavigatorConcurrentHardwareMixin {
|
||||||
public:
|
public:
|
||||||
// https://html.spec.whatwg.org/multipage/workers.html#dom-navigator-hardwareconcurrency
|
// https://html.spec.whatwg.org/multipage/workers.html#dom-navigator-hardwareconcurrency
|
||||||
WebIDL::UnsignedLongLong hardware_concurrency() { return 1; }
|
static WebIDL::UnsignedLongLong hardware_concurrency() { return Core::System::hardware_concurrency(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user