New issue
Advanced search Search tips

Issue 849568 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: 1
NextAction: ----
OS: ----
Pri: 1
Type: Task
Proj-VR

Blocked on:
issue 911329

Blocking:
issue 846521
issue 907591



Sign in to add a comment

Initialize VRDevices on first successful RequestSession

Project Member Reported by ijamardo@chromium.org, Jun 5 2018

Issue description

ARCoreDevice initializes some parts (the mailbox bridge and the GL thread) on construction and then some other parts (ARCore) during the first successful RequestSession call. Ideally, not even the GL thread should start if no session has been requested. 

While fixing this issue please note that multiple RequestSession can come from the render process and they should be correctly handled (with a container to store the remaining requests while one request is being resolved, for example).
 
Cc: offenwanger@chromium.org billorr@chromium.org
Components: Blink>WebVR
Labels: -Type-Bug -Pri-3 XR-Device Pri-2 Type-Task
Probably the best way to do this is to only create the object that owns these on requestSession(). We could either delay ARCoreDevice (and similar) creation or have a private implementation class backing it.
Blocking: 846521
Cc: -billorr@chromium.org
Labels: -Pri-2 Proj-XR Pri-1
Owner: billorr@chromium.org
Status: Assigned (was: Available)
Summary: Initialize VRDevices on first successful RequestSession (was: Initialize ARCoreDevice (GL thread, Bridge, ARCore, ...) on first successful RequestSession)
I'm changing the summary to address the general problem.
Labels: M-69
Components: Blink>WebXR
Labels: BlinkWebXR
Removing Blink>WebVR component and assigning to Blink>WebXR 
Labels: -BlinkWebXR
Removing Blink>WebVR component and assigning to Blink>WebXR 
Components: -Blink>WebVR
EstimatedDays: 1
Labels: -M-69 M-71
@billorr says 1 day for a simple fix and ~5d for refactoring that would make it more general across other devices. When fixing this bug, please file a new bug for a larger fix if you only do the simple fix.
Labels: AR-Cleanup
@billorr : what is the impact of not fixing this bug? do you think this is required/MUST (P1) or should fix (P2)?
Labels: -M-71 Target-71
ARCoreDevice has been refactored to clean up some of this, but we still create the mailbox_bridge_ and the context provider in ARCoreDevice's constructor.  When that is ready.  When that completes, we create arcore_gl_thread_ and start it.  We do delay initializing arcore until the ar dfm is installed.

GvrDevice has been changed to initialize when either VRDisplayInfo is needed for webvr (through EnsureInitialized()) or when a session is requested.

Desktop devices also need to be updated to delay initialization.


The 1-day "simple fix" is to just avoid calling mailbox_bridge_->CreateUnboundContextProvider() until requestSession, along with appropriate checking that we are in a valid state throughout.

With the larger refactor, browser-side requestSession will now do 1. call into provider to check that it can support the session. 2. call into the provider to ensure everything is up to date. 3. request permissions.  4. call into the device to actually request the session, which will start the runtimes and initialize the device if needed.  Note that step 4 requires the simple 1-day fix, but also applied to other devices.

I would consider 846521 to be blocking this, and it is effectively the 1-day fix specific for AR.
Blocking: 907591
Cc: -offenwanger@chromium.org
Labels: -Target-71 Target-73
I filed issue 907591 to track the desired overall outcome. It's not clear to me what specific part of that this issue tracks or whether it is now a duplicate. Feel free to use it for whatever makes sense to move us towards the desired outcome in issue 907591.
Blockedon: 911329

Sign in to add a comment