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

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: Remove no longer applicable TODO and early exit from reportViolation method. 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 {
2173 Vector<String> coreReportEndpoints;
2174 coreReportEndpoints.reserveInitialCapacity(reportEndpoints.size());
2175 for (const WebString& reportEndpoint : reportEndpoints)
2176 coreReportEndpoints.append(reportEndpoint);
2177
2178 auto redirectStatus = followedRedirect
2179 ? ResourceRequest::RedirectStatus::FollowedRedirect
2180 : ResourceRequest::RedirectStatus::NoRedirect;
2181
2182 ContentSecurityPolicy* policy = m_frame->securityContext()->contentSecurityP olicy();
2183 policy->logToConsole(ConsoleMessage::create(
2184 SecurityMessageSource,
2185 ErrorMessageLevel,
2186 consoleMessage));
2187 policy->reportViolation(
2188 directiveText,
2189 effectiveDirective,
2190 consoleMessage,
2191 blockedURL,
2192 coreReportEndpoints,
2193 header,
2194 static_cast<ContentSecurityPolicy::ViolationType>(violationType),
2195 nullptr, // contextFrame
alexmos 2016/08/09 18:01:20 Looking at when reportViolation uses |contextFrame
Łukasz Anforowicz 2016/08/09 22:23:20 I am not sure. I don't think so. I am not sure h
alexmos 2016/08/10 20:34:33 Acknowledged.
2196 redirectStatus,
2197 0); // contextLine
alexmos 2016/08/09 18:01:20 nit: maybe a comment explaining why we don't have/
Łukasz Anforowicz 2016/08/09 22:23:20 Done.
2198 }
2199
2163 } // namespace blink 2200 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698