| OLD | NEW |
| 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 | 5 |
| 6 #include "core/events/PromiseRejectionEvent.h" | 6 #include "core/events/PromiseRejectionEvent.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/DOMWrapperWorld.h" | 8 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 PromiseRejectionEvent::PromiseRejectionEvent() | |
| 13 { | |
| 14 } | |
| 15 | |
| 16 PromiseRejectionEvent::PromiseRejectionEvent(ScriptState* state, const AtomicStr
ing& type, const PromiseRejectionEventInit& initializer) | 12 PromiseRejectionEvent::PromiseRejectionEvent(ScriptState* state, const AtomicStr
ing& type, const PromiseRejectionEventInit& initializer) |
| 17 : Event(type, initializer) | 13 : Event(type, initializer) |
| 18 , m_scriptState(state) | 14 , m_scriptState(state) |
| 19 { | 15 { |
| 20 ThreadState::current()->registerPreFinalizer(this); | 16 ThreadState::current()->registerPreFinalizer(this); |
| 21 DCHECK(initializer.hasPromise()); | 17 DCHECK(initializer.hasPromise()); |
| 22 m_promise.set(initializer.promise().isolate(), initializer.promise().v8Value
()); | 18 m_promise.set(initializer.promise().isolate(), initializer.promise().v8Value
()); |
| 23 m_promise.setPhantom(); | 19 m_promise.setPhantom(); |
| 24 if (initializer.hasReason()) { | 20 if (initializer.hasReason()) { |
| 25 m_reason.set(initializer.reason().isolate(), initializer.reason().v8Valu
e()); | 21 m_reason.set(initializer.reason().isolate(), initializer.reason().v8Valu
e()); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 Event::trace(visitor); | 79 Event::trace(visitor); |
| 84 } | 80 } |
| 85 | 81 |
| 86 DEFINE_TRACE_WRAPPERS(PromiseRejectionEvent) | 82 DEFINE_TRACE_WRAPPERS(PromiseRejectionEvent) |
| 87 { | 83 { |
| 88 visitor->traceWrappers(&m_promise); | 84 visitor->traceWrappers(&m_promise); |
| 89 visitor->traceWrappers(&m_reason); | 85 visitor->traceWrappers(&m_reason); |
| 90 } | 86 } |
| 91 | 87 |
| 92 } // namespace blink | 88 } // namespace blink |
| OLD | NEW |