New issue
Advanced search Search tips

Issue 891832 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 31
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Task
Proj-VR
Proj-XR
Proj-XR-VR



Sign in to add a comment

Get rid of duplicate structs in OpenVR test hook

Project Member Reported by bsheedy@chromium.org, Oct 3

Issue description

Currently, VR browser tests use both the mojom datatypes and normal structs that contain the same data https://cs.chromium.org/chromium/src/device/vr/openvr/test/test_hook.h?q=submittedframedata&sq=package:chromium&dr=CSs&l=24.

There shouldn't be any reason why we can't use the mojom datatypes everywhere and avoid having to convert at either end of the Mojo interface.
 
Status: WontFix (was: Available)
After attempting to tackle this, it turns out there is a good reason to have the duplicate structs around, which is that there's a DLL boundary in addition to the Mojo boundary. We can't use Mojo types across the DLL boundary, as that results in them being auto-freed when going out of scope on a different heap. We need the POD duplicate structs to cross this boundary safely.

It might be possible to modify the Mojo allocation/freeing code to account for this, but that seems like overkill for this test-only code. We could also get away with passing in pointers across the DLL boundary and manually copying the data into them. However, we'd need a pointer for every struct instead of one pointer for the highest level struct since copying a nested struct would result in the same freeing issue. This would result in pretty much the same copying code, just going from Mojo to Mojo instead of Mojo to POD.

Sign in to add a comment