OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
6 #include "modules/screen_orientation/ScreenOrientation.h" | 6 #include "modules/screen_orientation/ScreenOrientation.h" |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
(...skipping 134 matching lines...) Loading... |
145 m_type = type; | 145 m_type = type; |
146 } | 146 } |
147 | 147 |
148 void ScreenOrientation::setAngle(unsigned short angle) | 148 void ScreenOrientation::setAngle(unsigned short angle) |
149 { | 149 { |
150 m_angle = angle; | 150 m_angle = angle; |
151 } | 151 } |
152 | 152 |
153 ScriptPromise ScreenOrientation::lock(ScriptState* state, const AtomicString& lo
ckString) | 153 ScriptPromise ScreenOrientation::lock(ScriptState* state, const AtomicString& lo
ckString) |
154 { | 154 { |
155 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(state); | 155 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(state); |
156 ScriptPromise promise = resolver->promise(); | 156 ScriptPromise promise = resolver->promise(); |
157 | 157 |
158 Document* document = m_frame ? m_frame->document() : 0; | 158 Document* document = m_frame ? m_frame->document() : 0; |
159 | 159 |
160 if (!document || !controller()) { | 160 if (!document || !controller()) { |
161 DOMException* exception = DOMException::create(InvalidStateError, "The o
bject is no longer associated to a document."); | 161 DOMException* exception = DOMException::create(InvalidStateError, "The o
bject is no longer associated to a document."); |
162 resolver->reject(exception); | 162 resolver->reject(exception); |
163 return promise; | 163 return promise; |
164 } | 164 } |
165 | 165 |
(...skipping 23 matching lines...) Loading... |
189 return ScreenOrientationController::from(*m_frame); | 189 return ScreenOrientationController::from(*m_frame); |
190 } | 190 } |
191 | 191 |
192 DEFINE_TRACE(ScreenOrientation) | 192 DEFINE_TRACE(ScreenOrientation) |
193 { | 193 { |
194 RefCountedGarbageCollectedEventTargetWithInlineData<ScreenOrientation>::trac
e(visitor); | 194 RefCountedGarbageCollectedEventTargetWithInlineData<ScreenOrientation>::trac
e(visitor); |
195 DOMWindowProperty::trace(visitor); | 195 DOMWindowProperty::trace(visitor); |
196 } | 196 } |
197 | 197 |
198 } // namespace blink | 198 } // namespace blink |
OLD | NEW |