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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <utility>
6
7 #include "base/bind.h"
8 #include "device/vr/vr_device.h"
9 #include "device/vr/vr_service_impl.h"
10
11 namespace device {
12
13 VRDeviceServiceImpl::VRDeviceServiceImpl(
14 mojo::InterfaceRequest<VRDeviceService> request,
15 VRDevice* device,
16 VRServiceImpl* service)
17 : binding_(this, std::move(request)) {
18 device_.reset(device);
19 service_.reset(service);
20 }
21
22 void VRDeviceServiceImpl::RegisterDisplayService(
23 VRDisplayServicePtr display_service) {
24 device_->RegisterDisplayService(service_.get(), std::move(display_service));
25 }
26
27 void VRDeviceServiceImpl::GetPose(const GetPoseCallback& callback) {
28 callback.Run(device_->GetPose(service_.get()));
29 }
30
31 void VRDeviceServiceImpl::ResetPose() {
32 device_->ResetPose(service_.get());
33 }
34
35 void VRDeviceServiceImpl::RequestPresent(
36 bool secureOrigin,
37 const RequestPresentCallback& callback) {
38 callback.Run(device_->RequestPresent(service_.get(), secureOrigin));
39 }
40
41 void VRDeviceServiceImpl::ExitPresent() {
42 device_->ExitPresent(service_.get());
43 }
44
45 void VRDeviceServiceImpl::SubmitFrame(VRPosePtr pose) {
46 device_->SubmitFrame(service_.get(), std::move(pose));
47 }
48
49 void VRDeviceServiceImpl::UpdateLayerBounds(VRLayerBoundsPtr leftBounds,
50 VRLayerBoundsPtr rightBounds) {
51 device_->UpdateLayerBounds(service_.get(), std::move(leftBounds),
52 std::move(rightBounds));
53 }
54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698