Changeset 244563 in webkit
- Timestamp:
- Apr 23, 2019 1:40:58 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244561 r244563 1 2019-04-23 Devin Rousso <drousso@apple.com> 2 3 ContentSecurityPolicy::logToConsole should include line/column number and source location 4 https://bugs.webkit.org/show_bug.cgi?id=114317 5 <rdar://problem/13614617> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/debugger/csp-exceptions.html: 10 1 11 2019-04-23 Andres Gonzalez <andresg_22@apple.com> 2 12 -
trunk/LayoutTests/inspector/debugger/csp-exceptions.html
r236766 r244563 33 33 34 34 WI.consoleManager.singleFireEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { 35 InspectorTest.assert(event.data.message.level === WI.ConsoleMessage.MessageLevel.Error); 36 InspectorTest.pass("CSP Exception Console Message: " + event.data.message.messageText); 35 let {message} = event.data; 36 InspectorTest.assert(message.level === WI.ConsoleMessage.MessageLevel.Error); 37 InspectorTest.assert(message.line > 0); 38 InspectorTest.assert(message.column > 0); 39 InspectorTest.pass("CSP Exception Console Message: " + message.messageText); 37 40 resolve(); 38 41 }); … … 54 57 WI.consoleManager.singleFireEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { 55 58 WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, tempPauseFailListener, null); 56 InspectorTest.assert(event.data.message.level === WI.ConsoleMessage.MessageLevel.Error); 59 60 let {message} = event.data; 61 InspectorTest.assert(message.level === WI.ConsoleMessage.MessageLevel.Error); 62 InspectorTest.assert(message.line > 0); 63 InspectorTest.assert(message.column > 0); 57 64 InspectorTest.expectFalse(didPause, "CSP Exception caused outside of script evaluation should not pause."); 58 InspectorTest.pass("CSP Exception Console Message: " + event.data.message.messageText);65 InspectorTest.pass("CSP Exception Console Message: " + message.messageText); 59 66 resolve(); 60 67 }); -
trunk/Source/WebCore/ChangeLog
r244562 r244563 1 2019-04-23 Devin Rousso <drousso@apple.com> 2 3 ContentSecurityPolicy::logToConsole should include line/column number and source location 4 https://bugs.webkit.org/show_bug.cgi?id=114317 5 <rdar://problem/13614617> 6 7 Reviewed by Timothy Hatcher. 8 9 No change in functionality. 10 11 * page/csp/ContentSecurityPolicy.h: 12 * page/csp/ContentSecurityPolicy.cpp: 13 (WebCore::ContentSecurityPolicy::reportViolation const): 14 (WebCore::ContentSecurityPolicy::logToConsole const): 15 1 16 2019-04-23 Devin Rousso <drousso@apple.com> 2 17 -
trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
r239427 r244563 671 671 void ContentSecurityPolicy::reportViolation(const String& effectiveViolatedDirective, const String& violatedDirective, const ContentSecurityPolicyDirectiveList& violatedDirectiveList, const URL& blockedURL, const String& consoleMessage, const String& sourceURL, const TextPosition& sourcePosition, JSC::ExecState* state) const 672 672 { 673 logToConsole(consoleMessage, sourceURL, sourcePosition.m_line, s tate);673 logToConsole(consoleMessage, sourceURL, sourcePosition.m_line, sourcePosition.m_column, state); 674 674 675 675 if (!m_isReportingEnabled) … … 850 850 } 851 851 852 void ContentSecurityPolicy::logToConsole(const String& message, const String& contextURL, const WTF::OrdinalNumber& contextLine, JSC::ExecState* state) const852 void ContentSecurityPolicy::logToConsole(const String& message, const String& contextURL, const WTF::OrdinalNumber& contextLine, const WTF::OrdinalNumber& contextColumn, JSC::ExecState* state) const 853 853 { 854 854 if (!m_isReportingEnabled) 855 855 return; 856 856 857 // FIXME: <http://webkit.org/b/114317> ContentSecurityPolicy::logToConsole should include a column number858 857 if (m_client) 859 858 m_client->addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, 0); 860 859 else if (m_scriptExecutionContext) 861 m_scriptExecutionContext->addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, contextURL, contextLine.oneBasedInt(), 0, state);860 m_scriptExecutionContext->addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, contextURL, contextLine.oneBasedInt(), contextColumn.oneBasedInt(), state); 862 861 } 863 862 -
trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h
r239427 r244563 174 174 175 175 private: 176 void logToConsole(const String& message, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), JSC::ExecState* = nullptr) const;176 void logToConsole(const String& message, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), const WTF::OrdinalNumber& contextColumn = WTF::OrdinalNumber::beforeFirst(), JSC::ExecState* = nullptr) const; 177 177 void updateSourceSelf(const SecurityOrigin&); 178 178 void applyPolicyToScriptExecutionContext();
Note: See TracChangeset
for help on using the changeset viewer.