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

Unified Diff: device/vr/vr_device.h

Issue 2658643003: Refactor GvrDelegate ownership into GvrDelegateProvider and fix more threading violations. (Closed)
Patch Set: Address comments Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/vr/test/fake_vr_device.cc ('k') | device/vr/vr_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/vr_device.h
diff --git a/device/vr/vr_device.h b/device/vr/vr_device.h
index d2ed8fa8dcebb27a547b58c819e05b9b38f6dad5..be836ee12016272cdbcb11abc704cd63380d2396 100644
--- a/device/vr/vr_device.h
+++ b/device/vr/vr_device.h
@@ -23,7 +23,8 @@ class DEVICE_VR_EXPORT VRDevice {
unsigned int id() const { return id_; }
- virtual mojom::VRDisplayInfoPtr GetVRDevice() = 0;
+ virtual void GetVRDevice(
+ const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) = 0;
virtual void ResetPose() = 0;
virtual void RequestPresent(const base::Callback<void(bool)>& callback) = 0;
@@ -55,6 +56,8 @@ class DEVICE_VR_EXPORT VRDevice {
void SetPresentingDisplay(VRDisplayImpl* display);
private:
+ void OnVRDisplayInfoCreated(mojom::VRDisplayInfoPtr vr_device_info);
+
std::set<VRDisplayImpl*> displays_;
VRDisplayImpl* presenting_display_;
@@ -63,6 +66,8 @@ class DEVICE_VR_EXPORT VRDevice {
static unsigned int next_id_;
+ base::WeakPtrFactory<VRDevice> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(VRDevice);
};
« no previous file with comments | « device/vr/test/fake_vr_device.cc ('k') | device/vr/vr_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698