| 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 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1877 bool ContentSecurityPolicy::experimentalFeaturesEnabled() const | 1877 bool ContentSecurityPolicy::experimentalFeaturesEnabled() const |
| 1878 { | 1878 { |
| 1879 return RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnab
led(); | 1879 return RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnab
led(); |
| 1880 } | 1880 } |
| 1881 | 1881 |
| 1882 bool ContentSecurityPolicy::shouldBypassMainWorld(ExecutionContext* context) | 1882 bool ContentSecurityPolicy::shouldBypassMainWorld(ExecutionContext* context) |
| 1883 { | 1883 { |
| 1884 if (context && context->isDocument()) { | 1884 if (context && context->isDocument()) { |
| 1885 Document* document = toDocument(context); | 1885 Document* document = toDocument(context); |
| 1886 if (document->frame()) | 1886 if (document->frame()) |
| 1887 return document->frame()->script()->shouldBypassMainWorldContentSecu
rityPolicy(); | 1887 return document->frame()->script().shouldBypassMainWorldContentSecur
ityPolicy(); |
| 1888 } | 1888 } |
| 1889 return false; | 1889 return false; |
| 1890 } | 1890 } |
| 1891 | 1891 |
| 1892 bool ContentSecurityPolicy::shouldSendViolationReport(const String& report) cons
t | 1892 bool ContentSecurityPolicy::shouldSendViolationReport(const String& report) cons
t |
| 1893 { | 1893 { |
| 1894 // Collisions have no security impact, so we can save space by storing only
the string's hash rather than the whole report. | 1894 // Collisions have no security impact, so we can save space by storing only
the string's hash rather than the whole report. |
| 1895 return !m_violationReportsSent.contains(report.impl()->hash()); | 1895 return !m_violationReportsSent.contains(report.impl()->hash()); |
| 1896 } | 1896 } |
| 1897 | 1897 |
| 1898 void ContentSecurityPolicy::didSendViolationReport(const String& report) | 1898 void ContentSecurityPolicy::didSendViolationReport(const String& report) |
| 1899 { | 1899 { |
| 1900 m_violationReportsSent.add(report.impl()->hash()); | 1900 m_violationReportsSent.add(report.impl()->hash()); |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 } // namespace WebCore | 1903 } // namespace WebCore |
| OLD | NEW |