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

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

Issue 2506853002: Fix double-deletion of VR Shell when exiting webVR in onPause. (Closed)
Patch Set: rebase 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 | « chrome/browser/android/vr_shell/vr_shell_delegate.cc ('k') | no next file » | 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 cf94fb2d5228869c8cb40c50568a19dd4ca68944..c484376ca86eb1d750eda5fed87c9455af288da6 100644
--- a/device/vr/android/gvr/gvr_device_provider.cc
+++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -69,6 +69,10 @@ bool GvrDeviceProvider::RequestPresent() {
// VR presentation exit requested by the API.
void GvrDeviceProvider::ExitPresent() {
SwitchToNonPresentingDelegate();
+ // If we're presenting currently stop.
+ GvrDelegateProvider* delegate_provider = GvrDelegateProvider::GetInstance();
+ if (delegate_provider)
+ delegate_provider->ExitWebVRPresent();
}
void GvrDeviceProvider::OnGvrDelegateReady(
@@ -111,9 +115,6 @@ void GvrDeviceProvider::SwitchToNonPresentingDelegate() {
// Remove GVR gamepad polling.
GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory(
GAMEPAD_SOURCE_GVR);
-
- // If we're presenting currently stop.
- delegate_provider->ExitWebVRPresent();
}
} // namespace device
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698