| Index: third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
|
| index 0a81bf5eac573291ba8cb145ce3b09a3b6648331..588723028776f05d74da2efb810aa7094509ed28 100644
|
| --- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
|
| @@ -29,6 +29,7 @@ SourceListDirective::SourceListDirective(const String& name,
|
| m_allowEval(false),
|
| m_allowDynamic(false),
|
| m_allowHashedAttributes(false),
|
| + m_reportSample(false),
|
| m_hashAlgorithmsUsed(0) {
|
| Vector<UChar> characters;
|
| value.appendTo(characters);
|
| @@ -103,6 +104,12 @@ bool SourceListDirective::allowHashedAttributes() const {
|
| return m_allowHashedAttributes;
|
| }
|
|
|
| +bool SourceListDirective::allowReportSample() const {
|
| + if (!m_policy->experimentalFeaturesEnabled())
|
| + return false;
|
| + return m_reportSample;
|
| +}
|
| +
|
| bool SourceListDirective::isNone() const {
|
| return !m_list.size() && !m_allowSelf && !m_allowStar && !m_allowInline &&
|
| !m_allowHashedAttributes && !m_allowEval && !m_allowDynamic &&
|
| @@ -211,6 +218,11 @@ bool SourceListDirective::parseSource(
|
| return true;
|
| }
|
|
|
| + if (equalIgnoringCase("'report-sample'", token)) {
|
| + addReportSample();
|
| + return true;
|
| + }
|
| +
|
| String nonce;
|
| if (!parseNonce(begin, end, nonce))
|
| return false;
|
| @@ -560,6 +572,10 @@ void SourceListDirective::addSourceUnsafeHashedAttributes() {
|
| m_allowHashedAttributes = true;
|
| }
|
|
|
| +void SourceListDirective::addReportSample() {
|
| + m_reportSample = true;
|
| +}
|
| +
|
| void SourceListDirective::addSourceNonce(const String& nonce) {
|
| m_nonces.insert(nonce);
|
| }
|
|
|