| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 stackTrace = FrameConsole::formatStackTraceString(consoleMessage->messag
e(), reportedCallStack); | 122 stackTrace = FrameConsole::formatStackTraceString(consoleMessage->messag
e(), reportedCallStack); |
| 123 frame().chromeClient().addMessageToConsole(m_frame, consoleMessage->source()
, consoleMessage->level(), consoleMessage->message(), lineNumber, messageURL, st
ackTrace); | 123 frame().chromeClient().addMessageToConsole(m_frame, consoleMessage->source()
, consoleMessage->level(), consoleMessage->message(), lineNumber, messageURL, st
ackTrace); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void FrameConsole::reportResourceResponseReceived(DocumentLoader* loader, unsign
ed long requestIdentifier, const ResourceResponse& response) | 126 void FrameConsole::reportResourceResponseReceived(DocumentLoader* loader, unsign
ed long requestIdentifier, const ResourceResponse& response) |
| 127 { | 127 { |
| 128 if (!loader) | 128 if (!loader) |
| 129 return; | 129 return; |
| 130 if (response.httpStatusCode() < 400) | 130 if (response.httpStatusCode() < 400) |
| 131 return; | 131 return; |
| 132 if (response.wasFallbackRequiredByServiceWorker()) |
| 133 return; |
| 132 String message = "Failed to load resource: the server responded with a statu
s of " + String::number(response.httpStatusCode()) + " (" + response.httpStatusT
ext() + ')'; | 134 String message = "Failed to load resource: the server responded with a statu
s of " + String::number(response.httpStatusCode()) + " (" + response.httpStatusT
ext() + ')'; |
| 133 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(N
etworkMessageSource, ErrorMessageLevel, message, response.url().string()); | 135 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(N
etworkMessageSource, ErrorMessageLevel, message, response.url().string()); |
| 134 consoleMessage->setRequestIdentifier(requestIdentifier); | 136 consoleMessage->setRequestIdentifier(requestIdentifier); |
| 135 addMessage(consoleMessage.release()); | 137 addMessage(consoleMessage.release()); |
| 136 } | 138 } |
| 137 | 139 |
| 138 String FrameConsole::formatStackTraceString(const String& originalMessage, PassR
efPtrWillBeRawPtr<ScriptCallStack> callStack) | 140 String FrameConsole::formatStackTraceString(const String& originalMessage, PassR
efPtrWillBeRawPtr<ScriptCallStack> callStack) |
| 139 { | 141 { |
| 140 StringBuilder stackTrace; | 142 StringBuilder stackTrace; |
| 141 for (size_t i = 0; i < callStack->size(); ++i) { | 143 for (size_t i = 0; i < callStack->size(); ++i) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 consoleMessage->setRequestIdentifier(requestIdentifier); | 204 consoleMessage->setRequestIdentifier(requestIdentifier); |
| 203 storage->reportMessage(m_frame->document(), consoleMessage.release()); | 205 storage->reportMessage(m_frame->document(), consoleMessage.release()); |
| 204 } | 206 } |
| 205 | 207 |
| 206 DEFINE_TRACE(FrameConsole) | 208 DEFINE_TRACE(FrameConsole) |
| 207 { | 209 { |
| 208 visitor->trace(m_frame); | 210 visitor->trace(m_frame); |
| 209 } | 211 } |
| 210 | 212 |
| 211 } // namespace blink | 213 } // namespace blink |
| OLD | NEW |