Skip to content

Commit

Permalink
Make next_input_id an InputId
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 9, 2020
1 parent 77d90d6 commit 94e8ce5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/script/dom/fakexrdevice.rs
Expand Up @@ -37,15 +37,16 @@ pub struct FakeXRDevice {
reflector: Reflector,
#[ignore_malloc_size_of = "defined in ipc-channel"]
sender: IpcSender<MockDeviceMsg>,
next_input_id: Cell<u32>,
#[ignore_malloc_size_of = "defined in webxr-api"]
next_input_id: Cell<InputId>,
}

impl FakeXRDevice {
pub fn new_inherited(sender: IpcSender<MockDeviceMsg>) -> FakeXRDevice {
FakeXRDevice {
reflector: Reflector::new(),
sender,
next_input_id: Cell::new(0),
next_input_id: Cell::new(InputId(0)),
}
}

Expand Down Expand Up @@ -191,8 +192,7 @@ impl FakeXRDeviceMethods for FakeXRDevice {
init: &FakeXRInputSourceInit,
) -> Fallible<DomRoot<FakeXRInputController>> {
let id = self.next_input_id.get();
self.next_input_id.set(id + 1);
let id = InputId(id);
self.next_input_id.set(InputId(id.0 + 1));

let handedness = init.handedness.into();
let target_ray_mode = init.targetRayMode.into();
Expand Down

0 comments on commit 94e8ce5

Please sign in to comment.