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/ScriptCallStack.h" | 8 #include "bindings/core/v8/ScriptCallStack.h" |
9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
10 #include "bindings/core/v8/ScriptValue.h" | 10 #include "bindings/core/v8/ScriptValue.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 args.append(ScriptValue(m_scriptState, v8String(m_scriptState->isola
te(), errorMessage))); | 79 args.append(ScriptValue(m_scriptState, v8String(m_scriptState->isola
te(), errorMessage))); |
80 args.append(ScriptValue(m_scriptState, reason)); | 80 args.append(ScriptValue(m_scriptState, reason)); |
81 ScriptArguments* arguments = ScriptArguments::create(m_scriptState,
args); | 81 ScriptArguments* arguments = ScriptArguments::create(m_scriptState,
args); |
82 | 82 |
83 String embedderErrorMessage = m_errorMessage; | 83 String embedderErrorMessage = m_errorMessage; |
84 if (embedderErrorMessage.isEmpty()) | 84 if (embedderErrorMessage.isEmpty()) |
85 embedderErrorMessage = errorMessage; | 85 embedderErrorMessage = errorMessage; |
86 else if (embedderErrorMessage.startsWith("Uncaught ")) | 86 else if (embedderErrorMessage.startsWith("Uncaught ")) |
87 embedderErrorMessage.insert(" (in promise)", 8); | 87 embedderErrorMessage.insert(" (in promise)", 8); |
88 | 88 |
89 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSou
rce, ErrorMessageLevel, embedderErrorMessage, m_resourceName, m_lineNumber, m_co
lumnNumber, m_callStack, m_scriptId); | 89 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSou
rce, ErrorMessageLevel, embedderErrorMessage, m_resourceName, m_lineNumber, m_co
lumnNumber, m_callStack, m_scriptId, arguments); |
90 consoleMessage->setScriptArguments(arguments); | |
91 m_consoleMessageId = consoleMessage->assignMessageId(); | 90 m_consoleMessageId = consoleMessage->assignMessageId(); |
92 executionContext->addConsoleMessage(consoleMessage); | 91 executionContext->addConsoleMessage(consoleMessage); |
93 } | 92 } |
94 | 93 |
95 m_callStack.clear(); | 94 m_callStack.clear(); |
96 } | 95 } |
97 | 96 |
98 void revoke() | 97 void revoke() |
99 { | 98 { |
100 ExecutionContext* executionContext = m_scriptState->getExecutionContext(
); | 99 ExecutionContext* executionContext = m_scriptState->getExecutionContext(
); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 } | 272 } |
274 } | 273 } |
275 } | 274 } |
276 | 275 |
277 void RejectedPromises::revokeNow(PassOwnPtr<Message> message) | 276 void RejectedPromises::revokeNow(PassOwnPtr<Message> message) |
278 { | 277 { |
279 message->revoke(); | 278 message->revoke(); |
280 } | 279 } |
281 | 280 |
282 } // namespace blink | 281 } // namespace blink |
OLD | NEW |