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

Side by Side Diff: device/vr/android/gvr/gvr_device.h

Issue 2570553004: Clean up some VrShell threading issues and remove unnecessary WeakPtr types. (Closed)
Patch Set: rebase Created 4 years 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 "base/memory/weak_ptr.h"
10 #include "device/vr/vr_device.h" 9 #include "device/vr/vr_device.h"
11 10
12 namespace gvr { 11 namespace gvr {
13 class GvrApi; 12 class GvrApi;
14 } // namespace gvr 13 } // namespace gvr
15 14
16 namespace device { 15 namespace device {
17 16
18 class GvrDeviceProvider; 17 class GvrDeviceProvider;
19 class GvrDelegate; 18 class GvrDelegate;
20 19
21 class GvrDevice : public VRDevice { 20 class GvrDevice : public VRDevice {
22 public: 21 public:
23 GvrDevice(GvrDeviceProvider* provider, 22 GvrDevice(GvrDeviceProvider* provider, GvrDelegate* delegate);
24 const base::WeakPtr<GvrDelegate>& delegate);
25 ~GvrDevice() override; 23 ~GvrDevice() override;
26 24
27 // VRDevice 25 // VRDevice
28 mojom::VRDisplayInfoPtr GetVRDevice() override; 26 mojom::VRDisplayInfoPtr GetVRDevice() override;
29 mojom::VRPosePtr GetPose() override; 27 mojom::VRPosePtr GetPose() override;
30 void ResetPose() override; 28 void ResetPose() override;
31 29
32 void RequestPresent(const base::Callback<void(bool)>& callback) override; 30 void RequestPresent(const base::Callback<void(bool)>& callback) override;
33 void SetSecureOrigin(bool secure_origin) override; 31 void SetSecureOrigin(bool secure_origin) override;
34 void ExitPresent() override; 32 void ExitPresent() override;
35 33
36 void SubmitFrame(mojom::VRPosePtr pose) override; 34 void SubmitFrame(mojom::VRPosePtr pose) override;
37 void UpdateLayerBounds(mojom::VRLayerBoundsPtr left_bounds, 35 void UpdateLayerBounds(mojom::VRLayerBoundsPtr left_bounds,
38 mojom::VRLayerBoundsPtr right_bounds) override; 36 mojom::VRLayerBoundsPtr right_bounds) override;
39 37
40 void SetDelegate(const base::WeakPtr<GvrDelegate>& delegate); 38 void SetDelegate(GvrDelegate* delegate);
41 39
42 private: 40 private:
43 gvr::GvrApi* GetGvrApi(); 41 gvr::GvrApi* GetGvrApi();
44 42
45 base::WeakPtr<GvrDelegate> delegate_; 43 GvrDelegate* delegate_;
46 GvrDeviceProvider* gvr_provider_; 44 GvrDeviceProvider* gvr_provider_;
47 bool secure_origin_ = false; 45 bool secure_origin_ = false;
48 uint32_t pose_index_ = 1; 46 uint32_t pose_index_ = 1;
49 47
50 DISALLOW_COPY_AND_ASSIGN(GvrDevice); 48 DISALLOW_COPY_AND_ASSIGN(GvrDevice);
51 }; 49 };
52 50
53 } // namespace device 51 } // namespace device
54 52
55 #endif // DEVICE_VR_ANDROID_GVR_DEVICE_H 53 #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