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

Unified Diff: content/browser/frame_host/csp_context_impl.h

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/browser/frame_host/csp_context_impl.h
diff --git a/content/browser/frame_host/csp_context_impl.h b/content/browser/frame_host/csp_context_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..00e35b425727141f35832ffa494114f4fb99cdf7
--- /dev/null
+++ b/content/browser/frame_host/csp_context_impl.h
@@ -0,0 +1,37 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_FRAME_HOST_CSP_CONTEXT_IMPL_H_
+#define CONTENT_BROWSER_FRAME_HOST_CSP_CONTEXT_IMPL_H_
+
+#include "content/common/content_security_policy/csp_context.h"
+
+namespace content {
+
+class RenderFrameHostImpl;
+
+// The CSPContext class represents the system on which the CSP are enforced.
alexmos 2017/02/24 06:40:27 nit: s/are/is/
arthursonzogni 2017/02/24 16:13:29 Acknowledged. (File removed)
+// The CSPContextImpl is an implementation of it on the browser process.
+// It defines: - how to send a CSP violation report.
+// - how to log a console error message.
+// - what are the schemes that bypass the CSP checks.
+class CSPContextImpl : public CSPContext {
+ public:
+ CSPContextImpl(RenderFrameHostImpl* render_frame);
alexmos 2017/02/24 06:40:27 nit: explicit
arthursonzogni 2017/02/24 16:13:29 Acknowledged. (File removed)
+ void LogToConsole(const std::string& message) override;
+
+ // Inform the renderer process that a navigation has been blocked by a content
+ // security policy.
+ void ReportViolation(const CSPViolationParams& violation_params) override;
+
+ private:
+ bool SchemeShouldBypassCSP(const base::StringPiece& scheme) override;
+
+ // Never nullptr;
+ RenderFrameHostImpl* render_frame_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_FRAME_HOST_CSP_CONTEXT_IMPL_H_ */

Powered by Google App Engine
This is Rietveld 408576698