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

Unified Diff: device/vr/openvr/openvr_device.h

Issue 2834843002: Add event listening function to openvr device (Closed)
Patch Set: Address billorr1@ comments Created 3 years, 7 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 | « no previous file | device/vr/openvr/openvr_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/openvr/openvr_device.h
diff --git a/device/vr/openvr/openvr_device.h b/device/vr/openvr/openvr_device.h
index 7bc96f90b982421daeb388aad3f6c11b1f5b6c10..f4b2d1d7258962f7a5d30acc86b64e78fe9a2f29 100644
--- a/device/vr/openvr/openvr_device.h
+++ b/device/vr/openvr/openvr_device.h
@@ -39,12 +39,19 @@ class OpenVRDevice : public VRDevice {
int16_t source_height) override;
void GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) override;
+ void OnPollingEvents();
+
private:
class OpenVRRenderLoop : public base::SimpleThread,
device::mojom::VRVSyncProvider {
public:
OpenVRRenderLoop(vr::IVRSystem* vr);
+ void RegisterPollingEventCallback(
+ const base::Callback<void()>& onPollingEvents);
+
+ void UnregisterPollingEventCallback();
+
void Bind(mojom::VRVSyncProviderRequest request);
mojom::VRPosePtr getPose();
@@ -56,6 +63,7 @@ class OpenVRDevice : public VRDevice {
callback) override;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
+ base::Callback<void()> on_polling_events_;
vr::IVRSystem* vr_system_;
mojo::Binding<device::mojom::VRVSyncProvider> binding_;
};
@@ -70,6 +78,10 @@ class OpenVRDevice : public VRDevice {
vr::IVRSystem* vr_system_;
+ bool is_polling_events_;
+
+ base::WeakPtrFactory<OpenVRDevice> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(OpenVRDevice);
};
« no previous file with comments | « no previous file | device/vr/openvr/openvr_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698