| Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
|
| index a95f10fc30b00e4b0c321788ff8a452a85917c96..617a4b8cb8920bb3c12a3807357a905e4bd6b0ad 100644
|
| --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
|
| @@ -2068,6 +2068,34 @@ bool WebLocalFrameImpl::maybeRenderFallbackContent(
|
| return true;
|
| }
|
|
|
| +// Called when a navigation is blocked because a Content Security Policy (CSP)
|
| +// is infringed.
|
| +void WebLocalFrameImpl::reportContentSecurityPolicyViolation(
|
| + const blink::WebContentSecurityPolicyViolation& violation) {
|
| + DCHECK(frame() && frame()->document());
|
| + Document* document = frame()->document();
|
| + Vector<String> reportEndpoints;
|
| + for (const WebString& endPoint : violation.reportEndpoints)
|
| + reportEndpoints.push_back(endPoint);
|
| + document->contentSecurityPolicy()->reportViolation(
|
| + violation.directive, /* directiveText */
|
| + ContentSecurityPolicy::getDirectiveType(
|
| + violation.effectiveDirective), /* effectiveType */
|
| + violation.consoleMessage, /* consoleMessage */
|
| + violation.blockedUrl, /* blockedUrl */
|
| + reportEndpoints, /* reportEndpoints */
|
| + violation.header, /* header */
|
| + static_cast<ContentSecurityPolicyHeaderType>(violation.disposition),
|
| + ContentSecurityPolicy::ViolationType::URLViolation, /* ViolationType */
|
| + nullptr, /* LocalFrame */
|
| + violation.afterRedirect ? RedirectStatus::FollowedRedirect
|
| + : RedirectStatus::NoRedirect,
|
| + // TODO(arthursonzogni, clamy) Provide the context line number here.
|
| + // See http://crbug.com/690946
|
| + 0, /* contextLine */
|
| + nullptr); /* Element */
|
| +}
|
| +
|
| bool WebLocalFrameImpl::isLoading() const {
|
| if (!frame() || !frame()->document())
|
| return false;
|
|
|