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

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

Issue 2510873003: Clean up WebVR RequestPresent and make callback asynchronous. (Closed)
Patch Set: 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
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 cf94fb2d5228869c8cb40c50568a19dd4ca68944..ca9e6973cbe7b1b28bc5bad6e6531459d786890e 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.

Powered by Google App Engine
This is Rietveld 408576698