Index: third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp b/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp |
index e88c277eb7a4b4a7eebe4782af8811efe5afd822..f62c1e4e7f3ec0b8230ce6b81feaade3d033c0f3 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp |
@@ -227,25 +227,32 @@ void RejectedPromises::handlerAdded(v8::PromiseRejectMessage data) |
} |
} |
+PassOwnPtrWillBeRawPtr<RejectedPromises::MessageQueue> RejectedPromises::createMessageQueue() |
+{ |
+ return adoptPtrWillBeNoop(new MessageQueue()); |
+} |
+ |
void RejectedPromises::dispose() |
{ |
- if (!m_queue.isEmpty()) { |
- OwnPtrWillBeRawPtr<WillBeHeapDeque<OwnPtrWillBeMember<Message>>> queue = adoptPtr(new WillBeHeapDeque<OwnPtrWillBeMember<Message>>()); |
- queue->swap(m_queue); |
- processQueueNow(queue.release()); |
- } |
+ if (m_queue.isEmpty()) |
+ return; |
+ |
+ OwnPtrWillBeRawPtr<MessageQueue> queue = createMessageQueue(); |
+ queue->swap(m_queue); |
+ processQueueNow(queue.release()); |
} |
void RejectedPromises::processQueue() |
{ |
if (m_queue.isEmpty()) |
return; |
- OwnPtrWillBeRawPtr<WillBeHeapDeque<OwnPtrWillBeMember<Message>>> queue = adoptPtr(new WillBeHeapDeque<OwnPtrWillBeMember<Message>>()); |
+ |
+ OwnPtrWillBeRawPtr<MessageQueue> queue = createMessageQueue(); |
queue->swap(m_queue); |
Platform::current()->currentThread()->scheduler()->timerTaskRunner()->postTask(FROM_HERE, new Task(bind(&RejectedPromises::processQueueNow, this, queue.release()))); |
} |
-void RejectedPromises::processQueueNow(PassOwnPtrWillBeRawPtr<WillBeHeapDeque<OwnPtrWillBeMember<Message>>> queue) |
+void RejectedPromises::processQueueNow(PassOwnPtrWillBeRawPtr<MessageQueue> queue) |
{ |
// Remove collected handlers. |
for (size_t i = 0; i < m_reportedAsErrors.size();) { |