| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 if (embedderErrorMessage.isEmpty()) | 83 if (embedderErrorMessage.isEmpty()) |
| 84 embedderErrorMessage = errorMessage; | 84 embedderErrorMessage = errorMessage; |
| 85 else if (embedderErrorMessage.startsWith("Uncaught ")) | 85 else if (embedderErrorMessage.startsWith("Uncaught ")) |
| 86 embedderErrorMessage.insert(" (in promise)", 8); | 86 embedderErrorMessage.insert(" (in promise)", 8); |
| 87 | 87 |
| 88 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSou
rce, ErrorMessageLevel, embedderErrorMessage, std::move(m_location), arguments); | 88 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSou
rce, ErrorMessageLevel, embedderErrorMessage, std::move(m_location), arguments); |
| 89 m_consoleMessageId = consoleMessage->assignMessageId(); | 89 m_consoleMessageId = consoleMessage->assignMessageId(); |
| 90 executionContext->addConsoleMessage(consoleMessage); | 90 executionContext->addConsoleMessage(consoleMessage); |
| 91 } | 91 } |
| 92 | 92 |
| 93 m_location.clear(); | 93 m_location.reset(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void revoke() | 96 void revoke() |
| 97 { | 97 { |
| 98 ExecutionContext* executionContext = m_scriptState->getExecutionContext(
); | 98 ExecutionContext* executionContext = m_scriptState->getExecutionContext(
); |
| 99 if (!executionContext) | 99 if (!executionContext) |
| 100 return; | 100 return; |
| 101 | 101 |
| 102 ScriptState::Scope scope(m_scriptState); | 102 ScriptState::Scope scope(m_scriptState); |
| 103 v8::Local<v8::Value> value = m_promise.newLocal(m_scriptState->isolate()
); | 103 v8::Local<v8::Value> value = m_promise.newLocal(m_scriptState->isolate()
); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 } | 267 } |
| 268 | 268 |
| 269 void RejectedPromises::revokeNow(PassOwnPtr<Message> message) | 269 void RejectedPromises::revokeNow(PassOwnPtr<Message> message) |
| 270 { | 270 { |
| 271 message->revoke(); | 271 message->revoke(); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace blink | 274 } // namespace blink |
| OLD | NEW |