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

Unified Diff: third_party/WebKit/Source/modules/vr/VRController.cpp

Issue 2614353002: Revert of Ensure navigator.getVRDisplays always resolves. (Closed)
Patch Set: Created 3 years, 11 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 | « third_party/WebKit/LayoutTests/vr/getVRDisplays_always_resolves.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/vr/VRController.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VRController.cpp b/third_party/WebKit/Source/modules/vr/VRController.cpp
index 58cdf5ccd050a5644c5e958cc5a600655792d71d..0f6b8e5d0f276e2a6528afc35b8418af8c2bcbb0 100644
--- a/third_party/WebKit/Source/modules/vr/VRController.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRController.cpp
@@ -23,8 +23,6 @@
m_binding(this) {
navigatorVR->document()->frame()->interfaceProvider()->getInterface(
mojo::MakeRequest(&m_service));
- m_service.set_connection_error_handler(convertToBaseCallback(
- WTF::bind(&VRController::dispose, wrapWeakPersistent(this))));
m_service->SetClient(
m_binding.CreateInterfacePtrAndBind(),
convertToBaseCallback(
@@ -34,10 +32,15 @@
VRController::~VRController() {}
void VRController::getDisplays(ScriptPromiseResolver* resolver) {
- // If we've previously synced the VRDisplays or no longer have a valid service
- // connection just return the current list. In the case of the service being
- // disconnected this will be an empty array.
- if (!m_service || m_displaySynced) {
+ if (!m_service) {
+ DOMException* exception = DOMException::create(
+ InvalidStateError, "The service is no longer active.");
+ resolver->reject(exception);
+ return;
+ }
+
+ // If we've previously synced the VRDisplays just return the current list.
+ if (m_displaySynced) {
resolver->resolve(m_displays);
return;
}
@@ -103,11 +106,6 @@
// Shutdown all displays' message pipe
for (size_t i = 0; i < m_displays.size(); ++i)
m_displays[i]->dispose();
-
- m_displays.clear();
-
- // Ensure that any outstanding getDisplays promises are resolved.
- onGetDisplays();
}
DEFINE_TRACE(VRController) {
« no previous file with comments | « third_party/WebKit/LayoutTests/vr/getVRDisplays_always_resolves.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698