forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create interface for VRDeviceProvider::Initialize
This replaces the four callbacks that were being passed into the VRDeviceProvider::Initialize method with a VRDeviceProviderClient interface. This helps to improve the readability of the methods, since some of the callbacks being passed into Initialize had quite a few parameters and were unwieldy. Further, this makes it simpler to provide a means for the device providers to access data should another expansion like that with the FrameSinkClient become necessary in the future. The use of a raw pointer being passed into Initialize which some of the VRDeviceProviders maintain a reference to is just as safe as the existing callback code, which used base::Unretained in it's bindings. This change should be a purely mechanical change, switching the use of the callbacks with direct calls onto a cached client object. Future improvements to this area could investigate a safer pattern, but the fact that the XRRuntimeManagerImpl is effectively a singleton and is guaranteed to outlive the providers is a fairly safe pattern. There are some further potential issues with the Orientation device provider, where if there is an already initialized device, we may not trigger the initialized callback; but it is unclear if this is a case that can actually be hit today, and was also left as-is in the interests of trying to keep this change mechanical. Bug: 864026 Change-Id: I9bf7648ff202cb5f9c0765aa31de707c0a72f936 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3343629 Reviewed-by: Klaus Weidner <klausw@chromium.org> Commit-Queue: Alexander Cooper <alcooper@chromium.org> Cr-Commit-Position: refs/heads/main@{#952531}
- Loading branch information
1 parent
66a3524
commit 6aa525b
Showing
15 changed files
with
139 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.