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

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

Issue 1107793002: Oilpan: have DOMException be on the heap by default. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RefPtrWillBeRawPtr<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 RefPtrWillBeRawPtr<DOMException> exception = DOMException::create(Invali dStateError, "The object 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
166 if (document->isSandboxed(SandboxOrientationLock)) { 166 if (document->isSandboxed(SandboxOrientationLock)) {
167 RefPtrWillBeRawPtr<DOMException> exception = DOMException::create(Securi tyError, "The document is sandboxed and lacks the 'allow-orientation-lock' flag. "); 167 DOMException* exception = DOMException::create(SecurityError, "The docum ent is sandboxed and lacks the 'allow-orientation-lock' flag.");
168 resolver->reject(exception); 168 resolver->reject(exception);
169 return promise; 169 return promise;
170 } 170 }
171 171
172 controller()->lock(stringToOrientationLock(lockString), new LockOrientationC allback(resolver)); 172 controller()->lock(stringToOrientationLock(lockString), new LockOrientationC allback(resolver));
173 return promise; 173 return promise;
174 } 174 }
175 175
176 void ScreenOrientation::unlock() 176 void ScreenOrientation::unlock()
177 { 177 {
(...skipping 11 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/push_messaging/PushError.cpp ('k') | Source/modules/serviceworkers/ServiceWorkerClients.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698