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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 return isAllowedByAllWithContextAndContent<&CSPDirectiveList::allowInlineSty
le>(m_policies, contextURL, contextLine, reportingStatus, styleContent); | 461 return isAllowedByAllWithContextAndContent<&CSPDirectiveList::allowInlineSty
le>(m_policies, contextURL, contextLine, reportingStatus, styleContent); |
462 } | 462 } |
463 | 463 |
464 bool ContentSecurityPolicy::allowEval(ScriptState* scriptState, ContentSecurityP
olicy::ReportingStatus reportingStatus, ContentSecurityPolicy::ExceptionStatus e
xceptionStatus) const | 464 bool ContentSecurityPolicy::allowEval(ScriptState* scriptState, ContentSecurityP
olicy::ReportingStatus reportingStatus, ContentSecurityPolicy::ExceptionStatus e
xceptionStatus) const |
465 { | 465 { |
466 return isAllowedByAllWithStateAndExceptionStatus<&CSPDirectiveList::allowEva
l>(m_policies, scriptState, reportingStatus, exceptionStatus); | 466 return isAllowedByAllWithStateAndExceptionStatus<&CSPDirectiveList::allowEva
l>(m_policies, scriptState, reportingStatus, exceptionStatus); |
467 } | 467 } |
468 | 468 |
469 bool ContentSecurityPolicy::allowDynamic() const | 469 bool ContentSecurityPolicy::allowDynamic() const |
470 { | 470 { |
471 if (!experimentalFeaturesEnabled()) | |
472 return false; | |
473 for (const auto& policy : m_policies) { | 471 for (const auto& policy : m_policies) { |
474 if (!policy->allowDynamic()) | 472 if (!policy->allowDynamic()) |
475 return false; | 473 return false; |
476 } | 474 } |
477 return true; | 475 return true; |
478 } | 476 } |
479 | 477 |
480 String ContentSecurityPolicy::evalDisabledErrorMessage() const | 478 String ContentSecurityPolicy::evalDisabledErrorMessage() const |
481 { | 479 { |
482 for (const auto& policy : m_policies) { | 480 for (const auto& policy : m_policies) { |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 // Collisions have no security impact, so we can save space by storing only
the string's hash rather than the whole report. | 1063 // Collisions have no security impact, so we can save space by storing only
the string's hash rather than the whole report. |
1066 return !m_violationReportsSent.contains(report.impl()->hash()); | 1064 return !m_violationReportsSent.contains(report.impl()->hash()); |
1067 } | 1065 } |
1068 | 1066 |
1069 void ContentSecurityPolicy::didSendViolationReport(const String& report) | 1067 void ContentSecurityPolicy::didSendViolationReport(const String& report) |
1070 { | 1068 { |
1071 m_violationReportsSent.add(report.impl()->hash()); | 1069 m_violationReportsSent.add(report.impl()->hash()); |
1072 } | 1070 } |
1073 | 1071 |
1074 } // namespace blink | 1072 } // namespace blink |
OLD | NEW |