[webvr] Replace nsRefPtrHashtable with std::vector for VRManager::mVRDisplays

NEW
Unassigned

Status

()

2 years ago
2 years ago

People

(Reporter: kip, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [gfx-noted][webvr])

(Reporter)

Description

2 years ago
std::vector is more appropriate than nsRefPtrHashtable for VRManager::mVRDisplays.

This is a remnant from prior refactoring.  Rationale for using the hashmap was that due to hardware hot-swapping, there will not always be a 1:1 relationship between the vector index and the displayid used for the entry.  The benefits of the hashmap are limited; however, as there is expected to be < 10 entries in the most extreme case.  Iterating over the small std::vector is probably faster than the hashmap.

In the pre-WebVR 1.0 API, this map was also going to hold individual sensors and controllers which could greatly increase the length of the array.  This is no longer the case as these have been moved out to Gamepad API.
Whiteboard: [gfx-noted]
Whiteboard: [gfx-noted] → [gfx-noted][webvr]
(Reporter)

Updated

2 years ago
Component: Graphics → WebVR
You need to log in before you can comment on or make changes to this bug.