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

Side by Side Diff: Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 1233173002: Have ScriptPromiseResolver on the Oilpan heap always. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix webusb ScriptPromiseResolver usage Created 5 years, 4 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 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...) Expand 10 before | Expand all | Expand 10 after
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...) Expand all
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
OLDNEW
« no previous file with comments | « Source/modules/screen_orientation/LockOrientationCallback.cpp ('k') | Source/modules/serviceworkers/ServiceWorkerClients.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698