Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2190183002: Forward CSP violation reporting from RenderFrameProxy to RenderFrameImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing how virtual method is declared. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698