| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/vr/VRController.h" | 5 #include "modules/vr/VRController.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // here. Upon calling SetClient in the constructor we should receive one call | 60 // here. Upon calling SetClient in the constructor we should receive one call |
| 61 // for each VRDisplay that was already connected at the time. | 61 // for each VRDisplay that was already connected at the time. |
| 62 void VRController::OnDisplayConnected( | 62 void VRController::OnDisplayConnected( |
| 63 device::mojom::blink::VRDisplayPtr display, | 63 device::mojom::blink::VRDisplayPtr display, |
| 64 device::mojom::blink::VRDisplayClientRequest request, | 64 device::mojom::blink::VRDisplayClientRequest request, |
| 65 device::mojom::blink::VRDisplayInfoPtr displayInfo) { | 65 device::mojom::blink::VRDisplayInfoPtr displayInfo) { |
| 66 VRDisplay* vrDisplay = | 66 VRDisplay* vrDisplay = |
| 67 new VRDisplay(m_navigatorVR, std::move(display), std::move(request)); | 67 new VRDisplay(m_navigatorVR, std::move(display), std::move(request)); |
| 68 vrDisplay->update(displayInfo); | 68 vrDisplay->update(displayInfo); |
| 69 vrDisplay->onConnected(); | 69 vrDisplay->onConnected(); |
| 70 m_displays.append(vrDisplay); | 70 m_displays.push_back(vrDisplay); |
| 71 | 71 |
| 72 if (m_displays.size() == m_numberOfSyncedDisplays) { | 72 if (m_displays.size() == m_numberOfSyncedDisplays) { |
| 73 m_displaySynced = true; | 73 m_displaySynced = true; |
| 74 onGetDisplays(); | 74 onGetDisplays(); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Called when the VRService has called OnDisplayConnected for all active | 78 // Called when the VRService has called OnDisplayConnected for all active |
| 79 // VRDisplays. | 79 // VRDisplays. |
| 80 void VRController::onDisplaysSynced(unsigned numberOfDisplays) { | 80 void VRController::onDisplaysSynced(unsigned numberOfDisplays) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 DEFINE_TRACE(VRController) { | 111 DEFINE_TRACE(VRController) { |
| 112 visitor->trace(m_navigatorVR); | 112 visitor->trace(m_navigatorVR); |
| 113 visitor->trace(m_displays); | 113 visitor->trace(m_displays); |
| 114 | 114 |
| 115 ContextLifecycleObserver::trace(visitor); | 115 ContextLifecycleObserver::trace(visitor); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |