| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2153 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) | 2153 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) |
| 2154 { | 2154 { |
| 2155 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); | 2155 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); |
| 2156 } | 2156 } |
| 2157 | 2157 |
| 2158 void WebLocalFrameImpl::clearActiveFindMatch() | 2158 void WebLocalFrameImpl::clearActiveFindMatch() |
| 2159 { | 2159 { |
| 2160 ensureTextFinder().clearActiveFindMatch(); | 2160 ensureTextFinder().clearActiveFindMatch(); |
| 2161 } | 2161 } |
| 2162 | 2162 |
| 2163 void WebLocalFrameImpl::reportContentSecurityPolicyViolation( |
| 2164 const WebString& directiveText, |
| 2165 const WebString& effectiveDirective, |
| 2166 const WebString& consoleMessage, |
| 2167 const WebURL& blockedURL, |
| 2168 const WebVector<WebString>& reportEndpoints, |
| 2169 const WebString& header, |
| 2170 WebContentSecurityPolicyViolationType violationType, |
| 2171 bool followedRedirect, |
| 2172 int contextLine) |
| 2173 { |
| 2174 Vector<String> coreReportEndpoints; |
| 2175 coreReportEndpoints.reserveInitialCapacity(reportEndpoints.size()); |
| 2176 for (const WebString& reportEndpoint : reportEndpoints) |
| 2177 coreReportEndpoints.append(reportEndpoint); |
| 2178 |
| 2179 auto redirectStatus = followedRedirect |
| 2180 ? ResourceRequest::RedirectStatus::FollowedRedirect |
| 2181 : ResourceRequest::RedirectStatus::NoRedirect; |
| 2182 |
| 2183 ContentSecurityPolicy* policy = m_frame->securityContext()->contentSecurityP
olicy(); |
| 2184 policy->logToConsole(ConsoleMessage::create( |
| 2185 SecurityMessageSource, |
| 2186 ErrorMessageLevel, |
| 2187 consoleMessage)); |
| 2188 policy->reportViolation( |
| 2189 directiveText, |
| 2190 effectiveDirective, |
| 2191 consoleMessage, |
| 2192 blockedURL, |
| 2193 coreReportEndpoints, |
| 2194 header, |
| 2195 static_cast<ContentSecurityPolicy::ViolationType>(violationType), |
| 2196 nullptr, // contextFrame |
| 2197 redirectStatus, |
| 2198 contextLine); |
| 2199 } |
| 2200 |
| 2163 } // namespace blink | 2201 } // namespace blink |
| OLD | NEW |