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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2655463006: PlzNavigate: Enforce 'frame-src' CSP on the browser. (Closed)
Patch Set: Add TODO in the FrameLoader. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 484c121cc1a39f246ff70bedbc639b2d98c5837a..3c0d2b9b422a20408f17d3fbadd26f2edc8f0ea0 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -664,7 +664,8 @@ CommonNavigationParams MakeCommonNavigationParams(
report_type, GURL(), GURL(),
static_cast<PreviewsState>(info.urlRequest.getPreviewsState()),
base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(),
- GetRequestBodyForWebURLRequest(info.urlRequest));
+ GetRequestBodyForWebURLRequest(info.urlRequest),
+ info.shouldBypassMainWorldCSP);
}
media::Context3D GetSharedMainThreadContext3D(
@@ -1552,6 +1553,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
OnTextTrackSettingsChanged)
IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent)
IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation)
+ IPC_MESSAGE_HANDLER(FrameMsg_ContentSecurityPolicyViolation,
+ OnContentSecurityPolicyViolation)
IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks,
OnGetSavableResourceLinks)
IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks,
@@ -5223,6 +5226,12 @@ void RenderFrameImpl::OnFailedNavigation(
browser_side_navigation_pending_ = false;
}
+void RenderFrameImpl::OnContentSecurityPolicyViolation(
+ const content::CSPViolationParams& violation_params) {
+ frame_->contentSecurityPolicyViolation(
+ BuildWebContentSecurityPolicyViolation(violation_params));
+}
+
WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
const NavigationPolicyInfo& info) {
// A content initiated navigation may have originated from a link-click,

Powered by Google App Engine
This is Rietveld 408576698