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

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

Issue 1808203005: [OnionSoup] Moving VR service from content to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to ToT and fixed the crash in webkit_unit_tests! 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/NavigatorVRDevice.h" 5 #include "modules/vr/NavigatorVRDevice.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ScriptPromise promise = resolver->promise(); 51 ScriptPromise promise = resolver->promise();
52 52
53 Document* document = m_frame ? m_frame->document() : 0; 53 Document* document = m_frame ? m_frame->document() : 0;
54 54
55 if (!document || !controller()) { 55 if (!document || !controller()) {
56 DOMException* exception = DOMException::create(InvalidStateError, "The o bject is no longer associated to a document."); 56 DOMException* exception = DOMException::create(InvalidStateError, "The o bject is no longer associated to a document.");
57 resolver->reject(exception); 57 resolver->reject(exception);
58 return promise; 58 return promise;
59 } 59 }
60 60
61 controller()->getDevices(new VRGetDevicesCallback(resolver, m_hardwareUnits. get())); 61 controller()->getDevices(adoptPtr(new VRGetDevicesCallback(resolver, m_hardw areUnits.get())));
62 62
63 return promise; 63 return promise;
64 } 64 }
65 65
66 VRController* NavigatorVRDevice::controller() 66 VRController* NavigatorVRDevice::controller()
67 { 67 {
68 if (!frame()) 68 if (!frame())
69 return 0; 69 return 0;
70 70
71 return VRController::from(*frame()); 71 return VRController::from(*frame());
(...skipping 12 matching lines...) Expand all
84 { 84 {
85 m_hardwareUnits = new VRHardwareUnitCollection(this); 85 m_hardwareUnits = new VRHardwareUnitCollection(this);
86 } 86 }
87 87
88 const char* NavigatorVRDevice::supplementName() 88 const char* NavigatorVRDevice::supplementName()
89 { 89 {
90 return "NavigatorVRDevice"; 90 return "NavigatorVRDevice";
91 } 91 }
92 92
93 } // namespace blink 93 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698