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

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

Issue 1967633002: Updated VRService to match the latest Blink WebVR interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: And we're back to removing all the array size checks Created 4 years, 7 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/NavigatorVR.h" 5 #include "modules/vr/NavigatorVR.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/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 ScriptPromise promise = resolver->promise(); 50 ScriptPromise promise = resolver->promise();
51 51
52 Document* document = m_frame ? m_frame->document() : 0; 52 Document* document = m_frame ? m_frame->document() : 0;
53 53
54 if (!document || !controller()) { 54 if (!document || !controller()) {
55 DOMException* exception = DOMException::create(InvalidStateError, "The o bject is no longer associated to a document."); 55 DOMException* exception = DOMException::create(InvalidStateError, "The o bject is no longer associated to a document.");
56 resolver->reject(exception); 56 resolver->reject(exception);
57 return promise; 57 return promise;
58 } 58 }
59 59
60 controller()->getDevices(WTF::wrapUnique(new VRGetDevicesCallback(resolver, m_displays.get()))); 60 controller()->getDisplays(WTF::wrapUnique(new VRGetDevicesCallback(resolver, m_displays.get())));
61 61
62 return promise; 62 return promise;
63 } 63 }
64 64
65 VRController* NavigatorVR::controller() 65 VRController* NavigatorVR::controller()
66 { 66 {
67 if (!frame()) 67 if (!frame())
68 return 0; 68 return 0;
69 69
70 return VRController::from(*frame()); 70 return VRController::from(*frame());
(...skipping 21 matching lines...) Expand all
92 NavigatorVR::~NavigatorVR() 92 NavigatorVR::~NavigatorVR()
93 { 93 {
94 } 94 }
95 95
96 const char* NavigatorVR::supplementName() 96 const char* NavigatorVR::supplementName()
97 { 97 {
98 return "NavigatorVR"; 98 return "NavigatorVR";
99 } 99 }
100 100
101 } // namespace blink 101 } // namespace blink
OLDNEW
« no previous file with comments | « content/browser/vr/vr_device_manager_unittest.cc ('k') | third_party/WebKit/Source/modules/vr/VRController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698