Index: third_party/WebKit/Source/core/events/PromiseRejectionEvent.cpp |
diff --git a/third_party/WebKit/Source/core/events/PromiseRejectionEvent.cpp b/third_party/WebKit/Source/core/events/PromiseRejectionEvent.cpp |
index ec621fc9becbad9dd145606d5057124abdccc440..fb8f76bc91b7fd1ccd5e1dc6fc8ed2a2f8a2bf89 100644 |
--- a/third_party/WebKit/Source/core/events/PromiseRejectionEvent.cpp |
+++ b/third_party/WebKit/Source/core/events/PromiseRejectionEvent.cpp |
@@ -17,6 +17,7 @@ PromiseRejectionEvent::PromiseRejectionEvent(ScriptState* state, const AtomicStr |
: Event(type, initializer) |
, m_scriptState(state) |
{ |
+ ThreadState::current()->registerPreFinalizer(this); |
ASSERT(initializer.hasPromise()); |
m_promise.set(initializer.promise().isolate(), initializer.promise().v8Value()); |
m_promise.setPhantom(); |
@@ -30,6 +31,14 @@ PromiseRejectionEvent::~PromiseRejectionEvent() |
{ |
} |
+void PromiseRejectionEvent::dispose() |
+{ |
+ // Clear ScopedPersistents so that V8 doesn't call phantom callbacks |
+ // (and touch the ScopedPersistents) after Oilpan starts lazy sweeping. |
+ m_promise.clear(); |
sof
2016/07/29 16:34:09
Please clear m_scriptState also.
|
+ m_reason.clear(); |
+} |
+ |
ScriptPromise PromiseRejectionEvent::promise(ScriptState* state) const |
{ |
// Return null when the promise is accessed by a different world than the world that created the promise. |