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

Unified Diff: extensions/common/csp_validator.h

Issue 2563843002: Restrict app sandbox's CSP to disallow loading web content in them. (Closed)
Patch Set: sync @tott Created 3 years, 12 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: extensions/common/csp_validator.h
diff --git a/extensions/common/csp_validator.h b/extensions/common/csp_validator.h
index 93676b0b8e66dcbb6f5a7d82d9ba0e337323aaf5..e4d1cb922cd8948fddb581a748b040107a7a9f9b 100644
--- a/extensions/common/csp_validator.h
+++ b/extensions/common/csp_validator.h
@@ -51,6 +51,18 @@ std::string SanitizeContentSecurityPolicy(
int options,
std::vector<InstallWarning>* warnings);
+// Given the Content Security Policy of an app sandbox page, returns the
+// effective CSP for that sandbox page.
+//
+// The effective policy restricts the page from loading external web content
+// (frames and scripts) within the page. This is done through adding 'self'
+// directive source to relevant CSP directive names.
+//
+// If |warnings| is not nullptr, any validation errors are appended to
+// |warnings|.
+std::string GetEffectiveSandoxedPageCSP(const std::string& policy,
+ std::vector<InstallWarning>* warnings);
+
// Checks whether the given |policy| enforces a unique origin sandbox as
// defined by http://www.whatwg.org/specs/web-apps/current-work/multipage/
// the-iframe-element.html#attr-iframe-sandbox. The policy must have the
« no previous file with comments | « chrome/test/data/extensions/api_test/sandboxed_pages_csp/sandboxed.html ('k') | extensions/common/csp_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698