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

Side by Side Diff: third_party/WebKit/Source/core/events/PromiseRejectionEvent.cpp

Issue 2479133002: [wrapper-tracing] Fix dispatching of TraceWrapperv8Reference (Closed)
Patch Set: Regenerate bindings results Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/events/PromiseRejectionEvent.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "core/events/PromiseRejectionEvent.h" 5 #include "core/events/PromiseRejectionEvent.h"
6 6
7 #include "bindings/core/v8/DOMWrapperWorld.h" 7 #include "bindings/core/v8/DOMWrapperWorld.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 PromiseRejectionEvent::PromiseRejectionEvent( 11 PromiseRejectionEvent::PromiseRejectionEvent(
12 ScriptState* state, 12 ScriptState* state,
13 const AtomicString& type, 13 const AtomicString& type,
14 const PromiseRejectionEventInit& initializer) 14 const PromiseRejectionEventInit& initializer)
15 : Event(type, initializer), 15 : Event(type, initializer),
16 m_scriptState(state), 16 m_scriptState(state),
17 m_promise(this), 17 m_promise(this),
18 m_reason(this) { 18 m_reason(this) {
19 ThreadState::current()->registerPreFinalizer(this); 19 ThreadState::current()->registerPreFinalizer(this);
20 DCHECK(initializer.hasPromise()); 20 DCHECK(initializer.hasPromise());
21 m_promise.set(initializer.promise().isolate(), 21 m_promise.set(initializer.promise().isolate(),
22 initializer.promise().v8Value()); 22 initializer.promise().v8Value());
23 m_promise.setPhantom();
24 if (initializer.hasReason()) { 23 if (initializer.hasReason()) {
25 m_reason.set(initializer.reason().isolate(), 24 m_reason.set(initializer.reason().isolate(),
26 initializer.reason().v8Value()); 25 initializer.reason().v8Value());
27 m_reason.setPhantom();
28 } 26 }
29 } 27 }
30 28
31 PromiseRejectionEvent::~PromiseRejectionEvent() {} 29 PromiseRejectionEvent::~PromiseRejectionEvent() {}
32 30
33 void PromiseRejectionEvent::dispose() { 31 void PromiseRejectionEvent::dispose() {
34 // Clear ScopedPersistents so that V8 doesn't call phantom callbacks 32 // Clear ScopedPersistents so that V8 doesn't call phantom callbacks
35 // (and touch the ScopedPersistents) after Oilpan starts lazy sweeping. 33 // (and touch the ScopedPersistents) after Oilpan starts lazy sweeping.
36 m_promise.clear(); 34 m_promise.clear();
37 m_reason.clear(); 35 m_reason.clear();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 DEFINE_TRACE(PromiseRejectionEvent) { 83 DEFINE_TRACE(PromiseRejectionEvent) {
86 Event::trace(visitor); 84 Event::trace(visitor);
87 } 85 }
88 86
89 DEFINE_TRACE_WRAPPERS(PromiseRejectionEvent) { 87 DEFINE_TRACE_WRAPPERS(PromiseRejectionEvent) {
90 visitor->traceWrappers(m_promise); 88 visitor->traceWrappers(m_promise);
91 visitor->traceWrappers(m_reason); 89 visitor->traceWrappers(m_reason);
92 } 90 }
93 91
94 } // namespace blink 92 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/PromiseRejectionEvent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698