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 19 matching lines...) Expand all Loading... | |
30 #include "core/page/PageConsole.h" | 30 #include "core/page/PageConsole.h" |
31 | 31 |
32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
33 #include "core/dom/ScriptableDocumentParser.h" | 33 #include "core/dom/ScriptableDocumentParser.h" |
34 #include "core/inspector/ConsoleAPITypes.h" | 34 #include "core/inspector/ConsoleAPITypes.h" |
35 #include "core/inspector/InspectorConsoleInstrumentation.h" | 35 #include "core/inspector/InspectorConsoleInstrumentation.h" |
36 #include "core/inspector/ScriptCallStack.h" | 36 #include "core/inspector/ScriptCallStack.h" |
37 #include "core/page/Chrome.h" | 37 #include "core/page/Chrome.h" |
38 #include "core/page/ChromeClient.h" | 38 #include "core/page/ChromeClient.h" |
39 #include "core/page/ConsoleTypes.h" | 39 #include "core/page/ConsoleTypes.h" |
40 #include "core/page/FormatConsoleMessage.h" | |
40 #include "core/page/Page.h" | 41 #include "core/page/Page.h" |
41 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
42 | 43 |
43 namespace WebCore { | 44 namespace WebCore { |
44 | 45 |
45 namespace { | 46 namespace { |
46 | 47 |
47 int muteCount = 0; | 48 int muteCount = 0; |
48 | 49 |
49 } | 50 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 return; | 85 return; |
85 | 86 |
86 if (callStack) | 87 if (callStack) |
87 InspectorInstrumentation::addMessageToConsole(page, source, LogMessageTy pe, level, message, callStack, requestIdentifier); | 88 InspectorInstrumentation::addMessageToConsole(page, source, LogMessageTy pe, level, message, callStack, requestIdentifier); |
88 else | 89 else |
89 InspectorInstrumentation::addMessageToConsole(page, source, LogMessageTy pe, level, message, url, lineNumber, columnNumber, state, requestIdentifier); | 90 InspectorInstrumentation::addMessageToConsole(page, source, LogMessageTy pe, level, message, url, lineNumber, columnNumber, state, requestIdentifier); |
90 | 91 |
91 if (source == CSSMessageSource) | 92 if (source == CSSMessageSource) |
92 return; | 93 return; |
93 | 94 |
94 page->chrome().client()->addMessageToConsole(source, level, message, lineNum ber, url); | 95 String chromeMessage; |
96 if (page->chrome().client()->shouldReportDetailedMessageForSource(url)) { | |
97 if (callStack) | |
98 chromeMessage = formatConsoleMessage(message, callStack); | |
99 else | |
100 chromeMessage = formatConsoleMessage(message, url, lineNumber, colum nNumber); | |
101 } | |
102 page->chrome().client()->addMessageToConsole(source, level, chromeMessage, l ineNumber, url); | |
pfeldman
2013/08/14 09:53:00
Wait, I thought we agreed on an additional text fi
Devlin
2013/08/14 17:00:40
Okay. Wasn't sure if plain-text should go with pl
| |
95 } | 103 } |
96 | 104 |
97 // static | 105 // static |
98 void PageConsole::mute() | 106 void PageConsole::mute() |
99 { | 107 { |
100 muteCount++; | 108 muteCount++; |
101 } | 109 } |
102 | 110 |
103 // static | 111 // static |
104 void PageConsole::unmute() | 112 void PageConsole::unmute() |
105 { | 113 { |
106 ASSERT(muteCount > 0); | 114 ASSERT(muteCount > 0); |
107 muteCount--; | 115 muteCount--; |
108 } | 116 } |
109 | 117 |
110 } // namespace WebCore | 118 } // namespace WebCore |
OLD | NEW |