diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/screen_orientation/screen_orientation.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/screen_orientation/screen_orientation.cc | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/chromium/third_party/blink/renderer/modules/screen_orientation/screen_orientation.cc b/chromium/third_party/blink/renderer/modules/screen_orientation/screen_orientation.cc index 79c43ee3e85..b232b8fb589 100644 --- a/chromium/third_party/blink/renderer/modules/screen_orientation/screen_orientation.cc +++ b/chromium/third_party/blink/renderer/modules/screen_orientation/screen_orientation.cc @@ -117,7 +117,9 @@ ScreenOrientation* ScreenOrientation::Create(LocalFrame* frame) { } ScreenOrientation::ScreenOrientation(LocalFrame* frame) - : ContextClient(frame), type_(kWebScreenOrientationUndefined), angle_(0) {} + : ExecutionContextClient(frame), + type_(kWebScreenOrientationUndefined), + angle_(0) {} ScreenOrientation::~ScreenOrientation() = default; @@ -128,7 +130,7 @@ const WTF::AtomicString& ScreenOrientation::InterfaceName() const { ExecutionContext* ScreenOrientation::GetExecutionContext() const { if (!GetFrame()) return nullptr; - return GetFrame()->GetDocument(); + return GetFrame()->GetDocument()->ToExecutionContext(); } String ScreenOrientation::type() const { @@ -148,22 +150,22 @@ void ScreenOrientation::SetAngle(uint16_t angle) { } ScriptPromise ScreenOrientation::lock(ScriptState* state, - const AtomicString& lock_string) { + const AtomicString& lock_string, + ExceptionState& exception_state) { Document* document = GetFrame() ? GetFrame()->GetDocument() : nullptr; if (!document || !Controller()) { - return ScriptPromise::RejectWithDOMException( - state, MakeGarbageCollected<DOMException>( - DOMExceptionCode::kInvalidStateError, - "The object is no longer associated to a document.")); + exception_state.ThrowDOMException( + DOMExceptionCode::kInvalidStateError, + "The object is no longer associated to a document."); + return ScriptPromise(); } - if (document->IsSandboxed(WebSandboxFlags::kOrientationLock)) { - return ScriptPromise::RejectWithDOMException( - state, MakeGarbageCollected<DOMException>( - DOMExceptionCode::kSecurityError, - "The document is sandboxed and lacks the " - "'allow-orientation-lock' flag.")); + if (document->IsSandboxed(mojom::blink::WebSandboxFlags::kOrientationLock)) { + exception_state.ThrowSecurityError( + "The document is sandboxed and lacks the " + "'allow-orientation-lock' flag."); + return ScriptPromise(); } auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(state); @@ -187,9 +189,9 @@ ScreenOrientationControllerImpl* ScreenOrientation::Controller() { return ScreenOrientationControllerImpl::From(*GetFrame()); } -void ScreenOrientation::Trace(blink::Visitor* visitor) { +void ScreenOrientation::Trace(Visitor* visitor) { EventTargetWithInlineData::Trace(visitor); - ContextClient::Trace(visitor); + ExecutionContextClient::Trace(visitor); } } // namespace blink |