Currently, the connection between [VRServiceImpl](https://cs.corp.google.com/clankium/src/device/vr/vr_service_impl.h) and [VRController](https://cs.corp.google.com/clankium/src/third_party/WebKit/Source/modules/vr/VRController.h) is made in two steps: 1. VRController creates VRServiceImpl through Mojo. 2. The VRController instances sets itself as the client of the created VRServiceImpl object. Between step 1 and 2 calls to the VRServiceImpl object cannot be forwarded to the VRController and are meaningless. It would be good if we could initialize VRServiceImpl's client_ in it's constructor.
+billorr whose work may affect this code.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f commit e2f982f7b5feb5e78f0fc43b57ead604ee041b6f Author: Anna Offenwanger <offenwanger@chromium.org> Date: Wed Aug 15 19:43:28 2018 Refactor vr_display_host into xr_device_impl Refactoring vr_display_host into xr_device_impl, and making it so that there is only one XRDeviceImpl, inline with what the WebXR spec expects. The xr_device_impl is not returned until requested, which is a step towards making the renderer not expect runtimes to be available until requested. Bug: 842025 , 701027 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:linux_vr;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: Iedb7dd4956ae1d98a9ae7811948ae645899df423 Reviewed-on: https://chromium-review.googlesource.com/1159468 Commit-Queue: Anna Offenwanger <offenwanger@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Bill Orr <billorr@chromium.org> Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org> Reviewed-by: Brian Sheedy <bsheedy@chromium.org> Cr-Commit-Position: refs/heads/master@{#583362} [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/chrome/browser/android/vr/arcore_device/arcore_device.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/chrome/browser/android/vr/vr_shell_gl.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/chrome/browser/vr/service/vr_service_impl.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/chrome/browser/vr/service/vr_service_impl.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/chrome/browser/vr/service/xr_device_impl.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/chrome/browser/vr/service/xr_device_impl.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/chrome/browser/vr/service/xr_runtime_manager.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/chrome/browser/vr/service/xr_runtime_manager.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/chrome/browser/vr/service/xr_runtime_manager_unittest.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/oculus/oculus_device.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/oculus/oculus_device.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/openvr/openvr_device.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/openvr/openvr_device.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/public/mojom/isolated_xr_service.mojom [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/public/mojom/vr_service.mojom [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/test/fake_vr_display_impl_client.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/test/fake_vr_service_client.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/test/fake_vr_service_client.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/vr_device_base.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/device/vr/vr_device_base.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/WebKit/LayoutTests/external/wpt/resources/chromium/webxr-test.js [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/WebKit/LayoutTests/vr/events_vrdisplayactivate.html [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/WebKit/LayoutTests/vr/events_vrdisplayconnect.html [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/WebKit/LayoutTests/vr/getEyeParameters_null.html [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/WebKit/LayoutTests/vr/getVRDisplays_one_display.html [delete] https://crrev.com/b22ea1fa7081741279cfffeed61c0c19da4c0a23/third_party/WebKit/LayoutTests/vr/getVRDisplays_two_display.html [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/WebKit/LayoutTests/vr/resources/vr-test-utils.js [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/WebKit/LayoutTests/xr/events_deviceconnect.html [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/WebKit/LayoutTests/xr/resources/xr-internal-device-mocking.js [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/vr/vr_controller.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/vr/vr_controller.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/vr/vr_display.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/vr/vr_display.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/xr/xr.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/xr/xr.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/xr/xr_device.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/xr/xr_device.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/xr/xr_frame_of_reference.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/xr/xr_frame_provider.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/xr/xr_session.cc [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/xr/xr_session.h [modify] https://crrev.com/e2f982f7b5feb5e78f0fc43b57ead604ee041b6f/third_party/blink/renderer/modules/xr/xr_webgl_layer.cc
Refactored so that client_ is no longer used when the service initializes. It therefore no longer makes sense to initialize it in the constructor.
Comment 1 by ddorwin@chromium.org
, Mar 13 2017