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

Unified Diff: device/vr/vr_device_service_impl.cc

Issue 2420743003: mojo VR interface simplified (Closed)
Patch Set: Address bajones@ comments and some clean up Created 4 years, 2 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
Index: device/vr/vr_device_service_impl.cc
diff --git a/device/vr/vr_device_service_impl.cc b/device/vr/vr_device_service_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b6dd78559ada29fbff8ac8c3a634584e4ee11711
--- /dev/null
+++ b/device/vr/vr_device_service_impl.cc
@@ -0,0 +1,54 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <utility>
+
+#include "base/bind.h"
+#include "device/vr/vr_device.h"
+#include "device/vr/vr_service_impl.h"
+
+namespace device {
+
+VRDeviceServiceImpl::VRDeviceServiceImpl(
+ mojo::InterfaceRequest<VRDeviceService> request,
+ VRDevice* device,
+ VRServiceImpl* service)
+ : binding_(this, std::move(request)) {
+ device_.reset(device);
+ service_.reset(service);
+}
+
+void VRDeviceServiceImpl::RegisterDisplayService(
+ VRDisplayServicePtr display_service) {
+ device_->RegisterDisplayService(service_.get(), std::move(display_service));
+}
+
+void VRDeviceServiceImpl::GetPose(const GetPoseCallback& callback) {
+ callback.Run(device_->GetPose(service_.get()));
+}
+
+void VRDeviceServiceImpl::ResetPose() {
+ device_->ResetPose(service_.get());
+}
+
+void VRDeviceServiceImpl::RequestPresent(
+ bool secureOrigin,
+ const RequestPresentCallback& callback) {
+ callback.Run(device_->RequestPresent(service_.get(), secureOrigin));
+}
+
+void VRDeviceServiceImpl::ExitPresent() {
+ device_->ExitPresent(service_.get());
+}
+
+void VRDeviceServiceImpl::SubmitFrame(VRPosePtr pose) {
+ device_->SubmitFrame(service_.get(), std::move(pose));
+}
+
+void VRDeviceServiceImpl::UpdateLayerBounds(VRLayerBoundsPtr leftBounds,
+ VRLayerBoundsPtr rightBounds) {
+ device_->UpdateLayerBounds(service_.get(), std::move(leftBounds),
+ std::move(rightBounds));
+}
+}

Powered by Google App Engine
This is Rietveld 408576698