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); | 89 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSou
rce, ErrorMessageLevel, embedderErrorMessage, m_resourceName, m_lineNumber, m_co
lumnNumber, m_callStack, m_scriptId); |
90 consoleMessage->setScriptArguments(arguments); | 90 consoleMessage->setScriptArguments(arguments); |
91 consoleMessage->setCallStack(m_callStack); | |
92 consoleMessage->setScriptId(m_scriptId); | |
93 m_consoleMessageId = consoleMessage->assignMessageId(); | 91 m_consoleMessageId = consoleMessage->assignMessageId(); |
94 executionContext->addConsoleMessage(consoleMessage); | 92 executionContext->addConsoleMessage(consoleMessage); |
95 } | 93 } |
96 | 94 |
97 m_callStack.clear(); | 95 m_callStack.clear(); |
98 } | 96 } |
99 | 97 |
100 void revoke() | 98 void revoke() |
101 { | 99 { |
102 ExecutionContext* executionContext = m_scriptState->getExecutionContext(
); | 100 ExecutionContext* executionContext = m_scriptState->getExecutionContext(
); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 } | 273 } |
276 } | 274 } |
277 } | 275 } |
278 | 276 |
279 void RejectedPromises::revokeNow(PassOwnPtr<Message> message) | 277 void RejectedPromises::revokeNow(PassOwnPtr<Message> message) |
280 { | 278 { |
281 message->revoke(); | 279 message->revoke(); |
282 } | 280 } |
283 | 281 |
284 } // namespace blink | 282 } // namespace blink |
OLD | NEW |