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

Unified Diff: device/vr/android/gvr/gvr_device_provider.cc

Issue 2510873003: Clean up WebVR RequestPresent and make callback asynchronous. (Closed)
Patch Set: Fix FakeVRDevice Created 4 years, 1 month 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/android/gvr/gvr_device_provider.h ('k') | device/vr/test/fake_vr_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/android/gvr/gvr_device_provider.cc
diff --git a/device/vr/android/gvr/gvr_device_provider.cc b/device/vr/android/gvr/gvr_device_provider.cc
index c484376ca86eb1d750eda5fed87c9455af288da6..31a28f3b4914d7fc25c6dae7c949d8a0467454c3 100644
--- a/device/vr/android/gvr/gvr_device_provider.cc
+++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -56,14 +56,16 @@ void GvrDeviceProvider::Initialize() {
}
}
-bool GvrDeviceProvider::RequestPresent() {
+void GvrDeviceProvider::RequestPresent(
+ const base::Callback<void(bool)>& callback) {
device::GvrDelegateProvider* delegate_provider =
device::GvrDelegateProvider::GetInstance();
if (!delegate_provider)
- return false;
+ return callback.Run(false);
// RequestWebVRPresent is async as a render thread may be created.
- return delegate_provider->RequestWebVRPresent(weak_ptr_factory_.GetWeakPtr());
+ delegate_provider->RequestWebVRPresent(weak_ptr_factory_.GetWeakPtr(),
+ callback);
}
// VR presentation exit requested by the API.
« no previous file with comments | « device/vr/android/gvr/gvr_device_provider.h ('k') | device/vr/test/fake_vr_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698