| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } else { | 94 } else { |
| 95 lineNumber = consoleMessage->lineNumber(); | 95 lineNumber = consoleMessage->lineNumber(); |
| 96 messageURL = consoleMessage->url(); | 96 messageURL = consoleMessage->url(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 messageStorage()->reportMessage(m_frame->document(), consoleMessage); | 99 messageStorage()->reportMessage(m_frame->document(), consoleMessage); |
| 100 | 100 |
| 101 if (consoleMessage->source() == NetworkMessageSource) | 101 if (consoleMessage->source() == NetworkMessageSource) |
| 102 return; | 102 return; |
| 103 | 103 |
| 104 RefPtrWillBeRawPtr<ScriptCallStack> reportedCallStack = nullptr; | 104 RefPtr<ScriptCallStack> reportedCallStack; |
| 105 if (consoleMessage->source() != ConsoleAPIMessageSource) { | 105 if (consoleMessage->source() != ConsoleAPIMessageSource) { |
| 106 if (consoleMessage->callStack() && frame().chromeClient().shouldReportDe
tailedMessageForSource(frame(), messageURL)) | 106 if (consoleMessage->callStack() && frame().chromeClient().shouldReportDe
tailedMessageForSource(frame(), messageURL)) |
| 107 reportedCallStack = consoleMessage->callStack(); | 107 reportedCallStack = consoleMessage->callStack(); |
| 108 } else { | 108 } else { |
| 109 if (!frame().host() || (consoleMessage->scriptArguments() && !consoleMes
sage->scriptArguments()->argumentCount())) | 109 if (!frame().host() || (consoleMessage->scriptArguments() && !consoleMes
sage->scriptArguments()->argumentCount())) |
| 110 return; | 110 return; |
| 111 | 111 |
| 112 if (!allClientReportingMessageTypes().contains(consoleMessage->type())) | 112 if (!allClientReportingMessageTypes().contains(consoleMessage->type())) |
| 113 return; | 113 return; |
| 114 | 114 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 129 if (response.httpStatusCode() < 400) | 129 if (response.httpStatusCode() < 400) |
| 130 return; | 130 return; |
| 131 if (response.wasFallbackRequiredByServiceWorker()) | 131 if (response.wasFallbackRequiredByServiceWorker()) |
| 132 return; | 132 return; |
| 133 String message = "Failed to load resource: the server responded with a statu
s of " + String::number(response.httpStatusCode()) + " (" + response.httpStatusT
ext() + ')'; | 133 String message = "Failed to load resource: the server responded with a statu
s of " + String::number(response.httpStatusCode()) + " (" + response.httpStatusT
ext() + ')'; |
| 134 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(N
etworkMessageSource, ErrorMessageLevel, message, response.url().string()); | 134 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(N
etworkMessageSource, ErrorMessageLevel, message, response.url().string()); |
| 135 consoleMessage->setRequestIdentifier(requestIdentifier); | 135 consoleMessage->setRequestIdentifier(requestIdentifier); |
| 136 addMessage(consoleMessage.release()); | 136 addMessage(consoleMessage.release()); |
| 137 } | 137 } |
| 138 | 138 |
| 139 String FrameConsole::formatStackTraceString(const String& originalMessage, PassR
efPtrWillBeRawPtr<ScriptCallStack> callStack) | 139 String FrameConsole::formatStackTraceString(const String& originalMessage, PassR
efPtr<ScriptCallStack> callStack) |
| 140 { | 140 { |
| 141 StringBuilder stackTrace; | 141 StringBuilder stackTrace; |
| 142 for (size_t i = 0; i < callStack->size(); ++i) { | 142 for (size_t i = 0; i < callStack->size(); ++i) { |
| 143 const ScriptCallFrame& frame = callStack->at(i); | 143 const ScriptCallFrame& frame = callStack->at(i); |
| 144 stackTrace.append("\n at " + (frame.functionName().length() ? frame.f
unctionName() : "(anonymous function)")); | 144 stackTrace.append("\n at " + (frame.functionName().length() ? frame.f
unctionName() : "(anonymous function)")); |
| 145 stackTrace.appendLiteral(" ("); | 145 stackTrace.appendLiteral(" ("); |
| 146 stackTrace.append(frame.sourceURL()); | 146 stackTrace.append(frame.sourceURL()); |
| 147 stackTrace.append(':'); | 147 stackTrace.append(':'); |
| 148 stackTrace.appendNumber(frame.lineNumber()); | 148 stackTrace.appendNumber(frame.lineNumber()); |
| 149 stackTrace.append(':'); | 149 stackTrace.append(':'); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 consoleMessage->setRequestIdentifier(requestIdentifier); | 203 consoleMessage->setRequestIdentifier(requestIdentifier); |
| 204 storage->reportMessage(m_frame->document(), consoleMessage.release()); | 204 storage->reportMessage(m_frame->document(), consoleMessage.release()); |
| 205 } | 205 } |
| 206 | 206 |
| 207 DEFINE_TRACE(FrameConsole) | 207 DEFINE_TRACE(FrameConsole) |
| 208 { | 208 { |
| 209 visitor->trace(m_frame); | 209 visitor->trace(m_frame); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace blink | 212 } // namespace blink |
| OLD | NEW |