mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
CanGc fixes in several files (#33958)
* few cangc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> * few cangc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
parent
1bf68567b8
commit
ebfea9b352
22 changed files with 170 additions and 129 deletions
|
@ -29,7 +29,7 @@ use crate::dom::pluginarray::PluginArray;
|
|||
use crate::dom::serviceworkercontainer::ServiceWorkerContainer;
|
||||
use crate::dom::window::Window;
|
||||
use crate::dom::xrsystem::XRSystem;
|
||||
use crate::script_runtime::JSContext;
|
||||
use crate::script_runtime::{CanGc, JSContext};
|
||||
|
||||
pub(super) fn hardware_concurrency() -> u64 {
|
||||
static CPUS: LazyLock<u64> = LazyLock::new(|| num_cpus::get().try_into().unwrap_or(1));
|
||||
|
@ -85,14 +85,14 @@ impl Navigator {
|
|||
self.gamepads.borrow().get(index).and_then(|g| g.get())
|
||||
}
|
||||
|
||||
pub fn set_gamepad(&self, index: usize, gamepad: &Gamepad) {
|
||||
pub fn set_gamepad(&self, index: usize, gamepad: &Gamepad, can_gc: CanGc) {
|
||||
if let Some(gamepad_to_set) = self.gamepads.borrow().get(index) {
|
||||
gamepad_to_set.set(Some(gamepad));
|
||||
}
|
||||
if self.has_gamepad_gesture.get() {
|
||||
gamepad.set_exposed(true);
|
||||
if self.global().as_window().Document().is_fully_active() {
|
||||
gamepad.notify_event(GamepadEventType::Connected);
|
||||
gamepad.notify_event(GamepadEventType::Connected, can_gc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue