OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google, Inc. All rights reserved. | 2 * Copyright (C) 2011 Google, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 case ContentSecurityPolicy::EvalViolation: | 1111 case ContentSecurityPolicy::EvalViolation: |
1112 init.setBlockedURI("eval"); | 1112 init.setBlockedURI("eval"); |
1113 break; | 1113 break; |
1114 case ContentSecurityPolicy::URLViolation: | 1114 case ContentSecurityPolicy::URLViolation: |
1115 init.setBlockedURI(stripURLForUseInReport( | 1115 init.setBlockedURI(stripURLForUseInReport( |
1116 document, blockedURL, redirectStatus, effectiveDirective)); | 1116 document, blockedURL, redirectStatus, effectiveDirective)); |
1117 break; | 1117 break; |
1118 } | 1118 } |
1119 } | 1119 } |
1120 init.setReferrer(document->referrer()); | 1120 init.setReferrer(document->referrer()); |
1121 init.setViolatedDirective(directiveText); | 1121 init.setViolatedDirective(effectiveDirective); |
1122 init.setEffectiveDirective(effectiveDirective); | 1122 init.setEffectiveDirective(effectiveDirective); |
1123 init.setOriginalPolicy(header); | 1123 init.setOriginalPolicy(header); |
1124 init.setDisposition(headerType == ContentSecurityPolicyHeaderTypeEnforce | 1124 init.setDisposition(headerType == ContentSecurityPolicyHeaderTypeEnforce |
1125 ? "enforce" | 1125 ? "enforce" |
1126 : "report"); | 1126 : "report"); |
1127 init.setSourceFile(String()); | 1127 init.setSourceFile(String()); |
1128 init.setLineNumber(contextLine); | 1128 init.setLineNumber(contextLine); |
1129 init.setColumnNumber(0); | 1129 init.setColumnNumber(0); |
1130 init.setStatusCode(0); | 1130 init.setStatusCode(0); |
1131 | 1131 |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 // Collisions have no security impact, so we can save space by storing only | 1544 // Collisions have no security impact, so we can save space by storing only |
1545 // the string's hash rather than the whole report. | 1545 // the string's hash rather than the whole report. |
1546 return !m_violationReportsSent.contains(report.impl()->hash()); | 1546 return !m_violationReportsSent.contains(report.impl()->hash()); |
1547 } | 1547 } |
1548 | 1548 |
1549 void ContentSecurityPolicy::didSendViolationReport(const String& report) { | 1549 void ContentSecurityPolicy::didSendViolationReport(const String& report) { |
1550 m_violationReportsSent.add(report.impl()->hash()); | 1550 m_violationReportsSent.add(report.impl()->hash()); |
1551 } | 1551 } |
1552 | 1552 |
1553 } // namespace blink | 1553 } // namespace blink |
OLD | NEW |