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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2655463006: PlzNavigate: Enforce 'frame-src' CSP on the browser. (Closed)
Patch Set: Rebase. 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 a2c64fe4c55ec089c14c048ddf7560c66e7dc815..f65c5b666138d903af0dfc162fdaa37d6b022568 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -680,7 +680,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(
@@ -1566,6 +1567,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_ReportContentSecurityPolicyViolation,
+ OnReportContentSecurityPolicyViolation)
IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks,
OnGetSavableResourceLinks)
IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks,
@@ -5246,6 +5249,12 @@ void RenderFrameImpl::OnFailedNavigation(
browser_side_navigation_pending_ = false;
}
+void RenderFrameImpl::OnReportContentSecurityPolicyViolation(
+ const content::CSPViolationParams& violation_params) {
+ frame_->reportContentSecurityPolicyViolation(
+ 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