| 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 20 matching lines...) Expand all Loading... |
| 31 #include "bindings/core/v8/SourceLocation.h" | 31 #include "bindings/core/v8/SourceLocation.h" |
| 32 #include "core/frame/FrameHost.h" | 32 #include "core/frame/FrameHost.h" |
| 33 #include "core/inspector/ConsoleMessage.h" | 33 #include "core/inspector/ConsoleMessage.h" |
| 34 #include "core/inspector/ConsoleMessageStorage.h" | 34 #include "core/inspector/ConsoleMessageStorage.h" |
| 35 #include "core/inspector/InspectorConsoleInstrumentation.h" | 35 #include "core/inspector/InspectorConsoleInstrumentation.h" |
| 36 #include "core/page/ChromeClient.h" | 36 #include "core/page/ChromeClient.h" |
| 37 #include "core/page/Page.h" | 37 #include "core/page/Page.h" |
| 38 #include "platform/network/ResourceError.h" | 38 #include "platform/network/ResourceError.h" |
| 39 #include "platform/network/ResourceResponse.h" | 39 #include "platform/network/ResourceResponse.h" |
| 40 #include "wtf/text/StringBuilder.h" | 40 #include "wtf/text/StringBuilder.h" |
| 41 #include <memory> |
| 41 | 42 |
| 42 namespace blink { | 43 namespace blink { |
| 43 | 44 |
| 44 namespace { | 45 namespace { |
| 45 | 46 |
| 46 int muteCount = 0; | 47 int muteCount = 0; |
| 47 | 48 |
| 48 } | 49 } |
| 49 | 50 |
| 50 FrameConsole::FrameConsole(LocalFrame& frame) | 51 FrameConsole::FrameConsole(LocalFrame& frame) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 74 return; | 75 return; |
| 75 if (consoleMessage->source() == NetworkMessageSource) | 76 if (consoleMessage->source() == NetworkMessageSource) |
| 76 return; | 77 return; |
| 77 | 78 |
| 78 String url = consoleMessage->location()->url(); | 79 String url = consoleMessage->location()->url(); |
| 79 String stackTrace; | 80 String stackTrace; |
| 80 if (consoleMessage->source() == ConsoleAPIMessageSource) { | 81 if (consoleMessage->source() == ConsoleAPIMessageSource) { |
| 81 if (!frame().host()) | 82 if (!frame().host()) |
| 82 return; | 83 return; |
| 83 if (frame().chromeClient().shouldReportDetailedMessageForSource(frame(),
url)) { | 84 if (frame().chromeClient().shouldReportDetailedMessageForSource(frame(),
url)) { |
| 84 OwnPtr<SourceLocation> location = SourceLocation::captureWithFullSta
ckTrace(); | 85 std::unique_ptr<SourceLocation> location = SourceLocation::captureWi
thFullStackTrace(); |
| 85 if (!location->isUnknown()) | 86 if (!location->isUnknown()) |
| 86 stackTrace = location->toString(); | 87 stackTrace = location->toString(); |
| 87 } | 88 } |
| 88 } else { | 89 } else { |
| 89 if (!consoleMessage->location()->isUnknown() && frame().chromeClient().s
houldReportDetailedMessageForSource(frame(), url)) | 90 if (!consoleMessage->location()->isUnknown() && frame().chromeClient().s
houldReportDetailedMessageForSource(frame(), url)) |
| 90 stackTrace = consoleMessage->location()->toString(); | 91 stackTrace = consoleMessage->location()->toString(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 frame().chromeClient().addMessageToConsole(m_frame, consoleMessage->source()
, consoleMessage->level(), consoleMessage->message(), consoleMessage->location()
->lineNumber(), url, stackTrace); | 94 frame().chromeClient().addMessageToConsole(m_frame, consoleMessage->source()
, consoleMessage->level(), consoleMessage->message(), consoleMessage->location()
->lineNumber(), url, stackTrace); |
| 94 } | 95 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 ConsoleMessage* consoleMessage = ConsoleMessage::createForRequest(NetworkMes
sageSource, ErrorMessageLevel, message.toString(), error.failingURL(), requestId
entifier); | 158 ConsoleMessage* consoleMessage = ConsoleMessage::createForRequest(NetworkMes
sageSource, ErrorMessageLevel, message.toString(), error.failingURL(), requestId
entifier); |
| 158 storage->reportMessage(m_frame->document(), consoleMessage); | 159 storage->reportMessage(m_frame->document(), consoleMessage); |
| 159 } | 160 } |
| 160 | 161 |
| 161 DEFINE_TRACE(FrameConsole) | 162 DEFINE_TRACE(FrameConsole) |
| 162 { | 163 { |
| 163 visitor->trace(m_frame); | 164 visitor->trace(m_frame); |
| 164 } | 165 } |
| 165 | 166 |
| 166 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |