Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2288)

Unified Diff: device/vr/vr_service_impl.cc

Issue 2329893002: Isolate a presenting VR device from pages other than the one presenting. (Closed)
Patch Set: Unit tests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/vr/vr_service_impl.h ('k') | device/vr/vr_service_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/vr_service_impl.cc
diff --git a/device/vr/vr_service_impl.cc b/device/vr/vr_service_impl.cc
index 6e784bfc4b2d5b499eec8c6b99e1247ba9d3a4cf..dfcc9d387ab599f876c018827180e692cb23693c 100644
--- a/device/vr/vr_service_impl.cc
+++ b/device/vr/vr_service_impl.cc
@@ -48,8 +48,7 @@ void VRServiceImpl::GetDisplays(const GetDisplaysCallback& callback) {
}
void VRServiceImpl::GetPose(uint32_t index, const GetPoseCallback& callback) {
- VRDeviceManager* device_manager = VRDeviceManager::GetInstance();
- VRDevice* device = device_manager->GetDevice(index);
+ VRDevice* device = VRDeviceManager::GetAllowedDevice(this, index);
if (device) {
callback.Run(device->GetPose());
@@ -59,38 +58,31 @@ void VRServiceImpl::GetPose(uint32_t index, const GetPoseCallback& callback) {
}
void VRServiceImpl::ResetPose(uint32_t index) {
- VRDeviceManager* device_manager = VRDeviceManager::GetInstance();
- VRDevice* device = device_manager->GetDevice(index);
+ VRDevice* device = VRDeviceManager::GetAllowedDevice(this, index);
if (device)
device->ResetPose();
}
-void VRServiceImpl::RequestPresent(uint32_t index) {
+void VRServiceImpl::RequestPresent(uint32_t index,
+ const RequestPresentCallback& callback) {
VRDeviceManager* device_manager = VRDeviceManager::GetInstance();
- VRDevice* device = device_manager->GetDevice(index);
- if (device)
- device->RequestPresent();
+ callback.Run(device_manager->RequestPresent(this, index));
}
void VRServiceImpl::ExitPresent(uint32_t index) {
VRDeviceManager* device_manager = VRDeviceManager::GetInstance();
- VRDevice* device = device_manager->GetDevice(index);
- if (device)
- device->ExitPresent();
+ device_manager->ExitPresent(this, index);
}
-void VRServiceImpl::SubmitFrame(uint32_t index) {
+void VRServiceImpl::SubmitFrame(uint32_t index, VRPosePtr pose) {
VRDeviceManager* device_manager = VRDeviceManager::GetInstance();
- VRDevice* device = device_manager->GetDevice(index);
- if (device)
- device->SubmitFrame();
+ device_manager->SubmitFrame(this, index, std::move(pose));
}
void VRServiceImpl::UpdateLayerBounds(uint32_t index,
VRLayerBoundsPtr leftBounds,
VRLayerBoundsPtr rightBounds) {
- VRDeviceManager* device_manager = VRDeviceManager::GetInstance();
- VRDevice* device = device_manager->GetDevice(index);
+ VRDevice* device = VRDeviceManager::GetAllowedDevice(this, index);
if (device)
device->UpdateLayerBounds(std::move(leftBounds), std::move(rightBounds));
}
« no previous file with comments | « device/vr/vr_service_impl.h ('k') | device/vr/vr_service_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698