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

Side by Side Diff: device/vr/test/fake_vr_device.h

Issue 2658643003: Refactor GvrDelegate ownership into GvrDelegateProvider and fix more threading violations. (Closed)
Patch Set: Address comments Created 3 years, 10 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
« no previous file with comments | « device/vr/android/gvr/gvr_gamepad_data_fetcher.cc ('k') | device/vr/test/fake_vr_device.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ 5 #ifndef DEVICE_VR_TEST_FAKE_VR_DEVICE_H_
6 #define DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ 6 #define DEVICE_VR_TEST_FAKE_VR_DEVICE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "device/vr/vr_device.h" 10 #include "device/vr/vr_device.h"
11 #include "device/vr/vr_device_provider.h" 11 #include "device/vr/vr_device_provider.h"
12 #include "device/vr/vr_service_impl.h" 12 #include "device/vr/vr_service_impl.h"
13 13
14 namespace device { 14 namespace device {
15 15
16 class FakeVRDevice : public VRDevice { 16 class FakeVRDevice : public VRDevice {
17 public: 17 public:
18 explicit FakeVRDevice(); 18 explicit FakeVRDevice();
19 ~FakeVRDevice() override; 19 ~FakeVRDevice() override;
20 20
21 void InitBasicDevice(); 21 void InitBasicDevice();
22 22
23 void SetVRDevice(const mojom::VRDisplayInfoPtr& device); 23 void SetVRDevice(const mojom::VRDisplayInfoPtr& device);
24 24
25 mojom::VRDisplayInfoPtr GetVRDevice() override; 25 // VRDevice
26 void GetVRDevice(
27 const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) override;
26 void ResetPose() override; 28 void ResetPose() override;
27 29
28 void RequestPresent(const base::Callback<void(bool)>& callback) override; 30 void RequestPresent(const base::Callback<void(bool)>& callback) override;
29 void SetSecureOrigin(bool secure_origin) override; 31 void SetSecureOrigin(bool secure_origin) override;
30 void ExitPresent() override; 32 void ExitPresent() override;
31 void SubmitFrame(mojom::VRPosePtr pose) override; 33 void SubmitFrame(mojom::VRPosePtr pose) override;
32 void UpdateLayerBounds(int16_t frame_index, 34 void UpdateLayerBounds(int16_t frame_index,
33 mojom::VRLayerBoundsPtr leftBounds, 35 mojom::VRLayerBoundsPtr leftBounds,
34 mojom::VRLayerBoundsPtr rightBounds) override; 36 mojom::VRLayerBoundsPtr rightBounds) override;
35 void GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) override; 37 void GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) override;
36 38
37 private: 39 private:
38 mojom::VREyeParametersPtr InitEye(float fov, float offset, uint32_t size); 40 mojom::VREyeParametersPtr InitEye(float fov, float offset, uint32_t size);
39 41
40 mojom::VRDisplayInfoPtr device_; 42 mojom::VRDisplayInfoPtr device_;
41 43
42 DISALLOW_COPY_AND_ASSIGN(FakeVRDevice); 44 DISALLOW_COPY_AND_ASSIGN(FakeVRDevice);
43 }; 45 };
44 46
45 } // namespace device 47 } // namespace device
46 48
47 #endif // DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ 49 #endif // DEVICE_VR_TEST_FAKE_VR_DEVICE_H_
OLDNEW
« no previous file with comments | « device/vr/android/gvr/gvr_gamepad_data_fetcher.cc ('k') | device/vr/test/fake_vr_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698