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

Side by Side Diff: device/vr/vr_device_client_impl.cc

Issue 2420743003: mojo VR interface simplified (Closed)
Patch Set: update binding process and update some unittest Created 4 years, 1 month 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 VRDeviceClientImpl::VRDeviceClientImpl(
14 mojo::InterfaceRequest<VRDeviceClient> 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 VRDeviceClientImpl::GetPose(const GetPoseCallback& callback) {
23 callback.Run(device_->GetPose(service_.get()));
24 }
25
26 void VRDeviceClientImpl::ResetPose() {
27 device_->ResetPose(service_.get());
28 }
29
30 void VRDeviceClientImpl::RequestPresent(
31 bool secureOrigin,
32 const RequestPresentCallback& callback) {
33 callback.Run(device_->RequestPresent(service_.get(), secureOrigin));
34 }
35
36 void VRDeviceClientImpl::ExitPresent() {
37 device_->ExitPresent(service_.get());
38 }
39
40 void VRDeviceClientImpl::SubmitFrame(VRPosePtr pose) {
41 device_->SubmitFrame(service_.get(), std::move(pose));
42 }
43
44 void VRDeviceClientImpl::UpdateLayerBounds(VRLayerBoundsPtr leftBounds,
45 VRLayerBoundsPtr rightBounds) {
46 device_->UpdateLayerBounds(service_.get(), std::move(leftBounds),
47 std::move(rightBounds));
48 }
49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698