Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp |
| index cb2a42ea2bf70b3d84f72c2792319eea1db45e52..6aec61a2858bb5664918cc3455741de74ac9c24c 100644 |
| --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp |
| +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp |
| @@ -724,8 +724,9 @@ static void gatherSecurityPolicyViolationEventData(SecurityPolicyViolationEventI |
| } |
| } |
| -void ContentSecurityPolicy::reportViolation(const String& directiveText, const String& effectiveDirective, const String& consoleMessage, const KURL& blockedURL, const Vector<String>& reportEndpoints, const String& header, LocalFrame* contextFrame) |
| +void ContentSecurityPolicy::reportViolation(const String& directiveText, const String& effectiveDirective, const String& consoleMessage, const KURL& blockedURL, const Vector<String>& reportEndpoints, const String& header, ViolationType violationType, LocalFrame* contextFrame) |
| { |
| + ASSERT(violationType == FetchViolation || blockedURL.isEmpty()); |
| ASSERT((m_executionContext && !contextFrame) || (equalIgnoringCase(effectiveDirective, ContentSecurityPolicy::FrameAncestors) && contextFrame)); |
| // FIXME: Support sending reports from worker. |
| @@ -768,7 +769,17 @@ void ContentSecurityPolicy::reportViolation(const String& directiveText, const S |
| cspReport->setString("violated-directive", violationData.violatedDirective()); |
| cspReport->setString("effective-directive", violationData.effectiveDirective()); |
| cspReport->setString("original-policy", violationData.originalPolicy()); |
| - cspReport->setString("blocked-uri", violationData.blockedURI()); |
| + switch (violationType) { |
| + case EvalViolation: |
| + cspReport->setString("blocked-uri", "eval"); |
|
philipj_slow
2015/12/01 13:11:55
The string "eval" doesn't appear in any of the add
|
| + break; |
| + case FetchViolation: |
| + cspReport->setString("blocked-uri", violationData.blockedURI()); |
| + break; |
| + case InlineViolation: |
| + cspReport->setString("blocked-uri", "inline"); |
| + break; |
| + } |
| if (!violationData.sourceFile().isEmpty() && violationData.lineNumber()) { |
| cspReport->setString("source-file", violationData.sourceFile()); |
| cspReport->setNumber("line-number", violationData.lineNumber()); |