WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-114317-20190314150309.patch (text/plain), 7.04 KB, created by
Devin Rousso
on 2019-03-14 15:03:10 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-03-14 15:03:10 PDT
Size:
7.04 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8bff583d86e676261de7e8179a15700dec4fad7c..431d714834ced93a7a054a4d8d9f8f7fe0d495fb 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-03-14 Devin Rousso <drousso@apple.com> >+ >+ ContentSecurityPolicy::logToConsole should include line/column number and source location >+ https://bugs.webkit.org/show_bug.cgi?id=114317 >+ <rdar://problem/13614617> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No change in functionality. >+ >+ * page/csp/ContentSecurityPolicy.h: >+ * page/csp/ContentSecurityPolicy.cpp: >+ (WebCore::ContentSecurityPolicy::reportViolation const): >+ (WebCore::ContentSecurityPolicy::logToConsole const): >+ > 2019-03-14 Chris Dumez <cdumez@apple.com> > > Add WebsitePolicy for the client to specify the device orientation & motion access policy >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp >index 403dc60284b3aafc467af1919c65783c38e034b5..81ed7ed206d08cd57fc893e136cc37ea7ebc76de 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp >+++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp >@@ -670,7 +670,7 @@ void ContentSecurityPolicy::reportViolation(const String& effectiveViolatedDirec > > 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 > { >- logToConsole(consoleMessage, sourceURL, sourcePosition.m_line, state); >+ logToConsole(consoleMessage, sourceURL, sourcePosition.m_line, sourcePosition.m_column, state); > > if (!m_isReportingEnabled) > return; >@@ -849,16 +849,15 @@ void ContentSecurityPolicy::reportMissingReportURI(const String& policy) const > logToConsole("The Content Security Policy '" + policy + "' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header."); > } > >-void ContentSecurityPolicy::logToConsole(const String& message, const String& contextURL, const WTF::OrdinalNumber& contextLine, JSC::ExecState* state) const >+void ContentSecurityPolicy::logToConsole(const String& message, const String& contextURL, const WTF::OrdinalNumber& contextLine, const WTF::OrdinalNumber& contextColumn, JSC::ExecState* state) const > { > if (!m_isReportingEnabled) > return; > >- // FIXME: <http://webkit.org/b/114317> ContentSecurityPolicy::logToConsole should include a column number > if (m_client) > m_client->addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, 0); > else if (m_scriptExecutionContext) >- m_scriptExecutionContext->addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, contextURL, contextLine.oneBasedInt(), 0, state); >+ m_scriptExecutionContext->addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, contextURL, contextLine.oneBasedInt(), contextColumn.oneBasedInt(), state); > } > > void ContentSecurityPolicy::reportBlockedScriptExecutionToInspector(const String& directiveText) const >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.h b/Source/WebCore/page/csp/ContentSecurityPolicy.h >index 17f77c26a0fdba93af3836ac839cf9d7b6f9287a..314a37598576edd198c4ac45140e6fdfb692a2ca 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicy.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicy.h >@@ -173,7 +173,7 @@ public: > void setClient(ContentSecurityPolicyClient* client) { m_client = client; } > > private: >- void logToConsole(const String& message, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), JSC::ExecState* = nullptr) const; >+ 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; > void updateSourceSelf(const SecurityOrigin&); > void applyPolicyToScriptExecutionContext(); > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index d7ddfbf669e638e45aeafba8b5f9de4b0e08ab0d..8309d97172346dda0e82a730ea4b89bad9793b91 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-03-14 Devin Rousso <drousso@apple.com> >+ >+ ContentSecurityPolicy::logToConsole should include line/column number and source location >+ https://bugs.webkit.org/show_bug.cgi?id=114317 >+ <rdar://problem/13614617> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/debugger/csp-exceptions.html: >+ > 2019-03-14 Shawn Roberts <sroberts@apple.com> > > Unreviewed, rolling out r242931. >diff --git a/LayoutTests/inspector/debugger/csp-exceptions.html b/LayoutTests/inspector/debugger/csp-exceptions.html >index 45c40f950aa7b7949b54a8a8dcac12ccb27a4c64..40afc79c5af6d8bc8e50722f1492177d826fcd27 100644 >--- a/LayoutTests/inspector/debugger/csp-exceptions.html >+++ b/LayoutTests/inspector/debugger/csp-exceptions.html >@@ -32,8 +32,11 @@ function test() > }); > > WI.consoleManager.singleFireEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { >- InspectorTest.assert(event.data.message.level === WI.ConsoleMessage.MessageLevel.Error); >- InspectorTest.pass("CSP Exception Console Message: " + event.data.message.messageText); >+ let {message} = event.data; >+ InspectorTest.assert(message.level === WI.ConsoleMessage.MessageLevel.Error); >+ InspectorTest.assert(message.line > 0); >+ InspectorTest.assert(message.column > 0); >+ InspectorTest.pass("CSP Exception Console Message: " + message.messageText); > resolve(); > }); > } >@@ -53,9 +56,13 @@ function test() > }); > WI.consoleManager.singleFireEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { > WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, tempPauseFailListener, null); >- InspectorTest.assert(event.data.message.level === WI.ConsoleMessage.MessageLevel.Error); >+ >+ let {message} = event.data; >+ InspectorTest.assert(message.level === WI.ConsoleMessage.MessageLevel.Error); >+ InspectorTest.assert(message.line > 0); >+ InspectorTest.assert(message.column > 0); > InspectorTest.expectFalse(didPause, "CSP Exception caused outside of script evaluation should not pause."); >- InspectorTest.pass("CSP Exception Console Message: " + event.data.message.messageText); >+ InspectorTest.pass("CSP Exception Console Message: " + message.messageText); > resolve(); > }); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 114317
:
265985
|
362044
| 364694