Closed Bug 1291434 Opened 8 years ago Closed 6 years ago

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

Categories

(Core :: WebVR, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: kip, Unassigned)

Details

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

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]
Component: Graphics → WebVR

VRManager::mVRDisplays no longer exists. Closing.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.