| 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 #include "bindings/core/v8/RejectedPromises.h" | 5 #include "bindings/core/v8/RejectedPromises.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScopedPersistent.h" | 7 #include "bindings/core/v8/ScopedPersistent.h" |
| 8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
| 9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
| 10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 ++i; | 262 ++i; |
| 263 } | 263 } |
| 264 | 264 |
| 265 while (!queue->isEmpty()) { | 265 while (!queue->isEmpty()) { |
| 266 std::unique_ptr<Message> message = queue->takeFirst(); | 266 std::unique_ptr<Message> message = queue->takeFirst(); |
| 267 if (message->isCollected()) | 267 if (message->isCollected()) |
| 268 continue; | 268 continue; |
| 269 if (!message->hasHandler()) { | 269 if (!message->hasHandler()) { |
| 270 message->report(); | 270 message->report(); |
| 271 message->makePromiseWeak(); | 271 message->makePromiseWeak(); |
| 272 m_reportedAsErrors.append(std::move(message)); | 272 m_reportedAsErrors.push_back(std::move(message)); |
| 273 if (m_reportedAsErrors.size() > maxReportedHandlersPendingResolution) | 273 if (m_reportedAsErrors.size() > maxReportedHandlersPendingResolution) |
| 274 m_reportedAsErrors.remove(0, maxReportedHandlersPendingResolution / 10); | 274 m_reportedAsErrors.remove(0, maxReportedHandlersPendingResolution / 10); |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 } | 277 } |
| 278 | 278 |
| 279 void RejectedPromises::revokeNow(std::unique_ptr<Message> message) { | 279 void RejectedPromises::revokeNow(std::unique_ptr<Message> message) { |
| 280 message->revoke(); | 280 message->revoke(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace blink | 283 } // namespace blink |
| OLD | NEW |