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

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

Issue 2501793002: Prevent the browser from crashing when exiting pages that use WebVR. (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') | device/vr/vr_display_impl.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 2581f7b6ef55de14c79ae82b9b16a31f453a9c24..f3e34acb87fb03775295e55fccf6dad783c23a5f 100644
--- a/device/vr/android/gvr/gvr_device_provider.cc
+++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -26,12 +26,15 @@ namespace device {
GvrDeviceProvider::GvrDeviceProvider() : weak_ptr_factory_(this) {}
GvrDeviceProvider::~GvrDeviceProvider() {
+ GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory(
+ GAMEPAD_SOURCE_GVR);
+
device::GvrDelegateProvider* delegate_provider =
device::GvrDelegateProvider::GetInstance();
- if (delegate_provider)
+ if (delegate_provider) {
+ delegate_provider->ExitWebVRPresent();
delegate_provider->DestroyNonPresentingDelegate();
-
- ExitPresent();
+ }
}
void GvrDeviceProvider::GetDevices(std::vector<VRDevice*>* devices) {
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_delegate.cc ('k') | device/vr/vr_display_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698