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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRController.cpp

Issue 2361533003: Expose secure origin state to WebVR renderer (Closed)
Patch Set: Rebase Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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 "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "modules/vr/NavigatorVR.h" 10 #include "modules/vr/NavigatorVR.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 void VRController::resetPose(unsigned index) 53 void VRController::resetPose(unsigned index)
54 { 54 {
55 if (!m_service) 55 if (!m_service)
56 return; 56 return;
57 57
58 m_service->ResetPose(index); 58 m_service->ResetPose(index);
59 } 59 }
60 60
61 void VRController::requestPresent(ScriptPromiseResolver* resolver, unsigned inde x) 61 void VRController::requestPresent(ScriptPromiseResolver* resolver, unsigned inde x, bool secureOrigin)
62 { 62 {
63 if (!m_service) { 63 if (!m_service) {
64 DOMException* exception = DOMException::create(InvalidStateError, "The s ervice is no longer active."); 64 DOMException* exception = DOMException::create(InvalidStateError, "The s ervice is no longer active.");
65 resolver->reject(exception); 65 resolver->reject(exception);
66 return; 66 return;
67 } 67 }
68 68
69 m_service->RequestPresent(index, convertToBaseCallback(WTF::bind(&VRControll er::onPresentComplete, wrapPersistent(this), wrapPersistent(resolver), index))); 69 m_service->RequestPresent(index, secureOrigin, convertToBaseCallback(WTF::bi nd(&VRController::onPresentComplete, wrapPersistent(this), wrapPersistent(resolv er), index)));
70 } 70 }
71 71
72 void VRController::exitPresent(unsigned index) 72 void VRController::exitPresent(unsigned index)
73 { 73 {
74 if (!m_service) 74 if (!m_service)
75 return; 75 return;
76 76
77 m_service->ExitPresent(index); 77 m_service->ExitPresent(index);
78 } 78 }
79 79
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 DEFINE_TRACE(VRController) 213 DEFINE_TRACE(VRController)
214 { 214 {
215 visitor->trace(m_navigatorVR); 215 visitor->trace(m_navigatorVR);
216 visitor->trace(m_displays); 216 visitor->trace(m_displays);
217 217
218 ContextLifecycleObserver::trace(visitor); 218 ContextLifecycleObserver::trace(visitor);
219 } 219 }
220 220
221 } // namespace blink 221 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRController.h ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698