WebKit Bugzilla
Attachment 362044 Details for
Bug 114317
: ContentSecurityPolicy::logToConsole should include line/column number and source location
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-114317-20190214115650.patch (text/plain), 4.26 KB, created by
Devin Rousso
on 2019-02-14 11:56:51 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-02-14 11:56:51 PST
Size:
4.26 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d0130cd4537fc4e23d4bbf4803c171492908d917..9a429069779351703489b77aa6d19994d6fd4251 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-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-02-13 Ryosuke Niwa <rniwa@webkit.org> > > Crash in DOMTimer::fired >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(); >
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