At a high level, AR/VR (collectively known as XR) APIs are wrapped in XRRuntimes.
Some XRRuntimes must live in the browser process, while others must not live in the browser process. The ones that cannot live in the browser, are hosted in a service.
Magic window sessions are requested by sites that request poses, but render through the normal Chrome compositor pipeline. It serves as a basic mode that requires only some way to get orientation poses.
Immersive sessions are where the site wishes to request poses, then render content back to a display other than chrome. The common case for this is Head Mounted Displays (HMD), like Vive, Oculus, or Daydream.
This type of session allows for environment integration by providing functions that allow the site to query the environment, such as HitTest. A Environment Integration session may also supply data in addition to the pose, such as a camera frame.
VRService - lives in the browser process, corresponds to a single frame. Root object to obtain other XR objects.
XRDevice - lives in the browser process, implemented as XRDeviceImpl. Allows a client to start a session (either immersive/exclusive/presenting or non-immersive).
VRServiceClient - lives in the renderer process. Is notified when VRDisplays are connected.
VRDisplayClient - lives in the renderer process. Is notified when display settings change.
These interfaces allow communication betwee an XRRuntime and the renderer process. They may live in the browser process or may live in the isolated service.
All sessions need to be able to get data from a XR device.
XRFrameDataProvider - lives in the XRDevice process. Provides a way to obtain poses and other forms of data needed to render frames.
Presentation is exclusive access to a device, where the experience takes over the device's display, such as presenting a stereo view in an HMD.
XRPresentationProvider - lives in the XRDevice process. Implements the details for a presentation session, such as submitting frames to the underlying VR API.
XRPresentationClient - lives in the renderer process. Is notified when various rendering events occur, so it can reclaim/reuse textures.
The XRDevice process may be the browser process or an isolated service for different devices implementations. A device provider in the browser will choose to start the isolated device service when appropriate.
XRRuntime - an abstraction over a XR API. Lives in the XRDevice process. Exposes a way for the browser to register for events, and start sessions (Magic Window or Presentation).
XRSessionController - Lives in the XRDevice process. Allows the browser to pause or stop a session (MagicWindow or Presentation).
XRRuntimeEventListener - Lives in the browser process. Exposes runtime events to the browser.
IsolatedXRGamepadProvider and IsolatedXRGamepadProviderFactory - Live in the XRInput process, and allow GamepadDataFetchers living in the browser process to expose data from gamepads that cannot be queried from the browser process.
The XRInput process may be the browser process or a separate process depending on the platform.
XRTestHook allows a test to control the behavior of a fake implementation of OpenVR, and potentially other runtimes. This allows testing the entire stack of Chromium WebXR code end-to-end.