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

Side by Side Diff: device/vr/android/gvr/gvr_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_delegate.h ('k') | device/vr/android/gvr/gvr_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 2016 The Chromium Authors. All rights reserved. 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 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_ANDROID_GVR_DEVICE_H 5 #ifndef DEVICE_VR_ANDROID_GVR_DEVICE_H
6 #define DEVICE_VR_ANDROID_GVR_DEVICE_H 6 #define DEVICE_VR_ANDROID_GVR_DEVICE_H
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "device/vr/vr_device.h" 9 #include "device/vr/vr_device.h"
10 10
11 namespace gvr {
12 class GvrApi;
13 } // namespace gvr
14
15 namespace device { 11 namespace device {
16 12
17 class GvrDeviceProvider; 13 class GvrDeviceProvider;
18 class GvrDelegate; 14 class GvrDelegate;
19 15
20 class GvrDevice : public VRDevice { 16 class DEVICE_VR_EXPORT GvrDevice : public VRDevice {
21 public: 17 public:
22 GvrDevice(GvrDeviceProvider* provider, GvrDelegate* delegate); 18 GvrDevice(GvrDeviceProvider* provider);
23 ~GvrDevice() override; 19 ~GvrDevice() override;
24 20
25 // VRDevice 21 // VRDevice
26 mojom::VRDisplayInfoPtr GetVRDevice() override; 22 void GetVRDevice(
23 const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) override;
27 void ResetPose() override; 24 void ResetPose() override;
28 25
29 void RequestPresent(const base::Callback<void(bool)>& callback) override; 26 void RequestPresent(const base::Callback<void(bool)>& callback) override;
30 void SetSecureOrigin(bool secure_origin) override; 27 void SetSecureOrigin(bool secure_origin) override;
31 void ExitPresent() override; 28 void ExitPresent() override;
32 29
33 void SubmitFrame(mojom::VRPosePtr pose) override; 30 void SubmitFrame(mojom::VRPosePtr pose) override;
34 void UpdateLayerBounds(int16_t frame_index, 31 void UpdateLayerBounds(int16_t frame_index,
35 mojom::VRLayerBoundsPtr left_bounds, 32 mojom::VRLayerBoundsPtr left_bounds,
36 mojom::VRLayerBoundsPtr right_bounds) override; 33 mojom::VRLayerBoundsPtr right_bounds) override;
37 void GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) override; 34 void GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) override;
38 35 void OnDelegateChanged();
39 void SetDelegate(GvrDelegate* delegate);
40 36
41 private: 37 private:
42 gvr::GvrApi* GetGvrApi(); 38 GvrDelegate* GetGvrDelegate();
43 39
44 GvrDelegate* delegate_;
45 GvrDeviceProvider* gvr_provider_; 40 GvrDeviceProvider* gvr_provider_;
46 bool secure_origin_ = false; 41 bool secure_origin_ = false;
47 42
48 DISALLOW_COPY_AND_ASSIGN(GvrDevice); 43 DISALLOW_COPY_AND_ASSIGN(GvrDevice);
49 }; 44 };
50 45
51 } // namespace device 46 } // namespace device
52 47
53 #endif // DEVICE_VR_ANDROID_GVR_DEVICE_H 48 #endif // DEVICE_VR_ANDROID_GVR_DEVICE_H
OLDNEW
« no previous file with comments | « device/vr/android/gvr/gvr_delegate.h ('k') | device/vr/android/gvr/gvr_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698