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

Unified Diff: content/browser/child_process_security_policy_impl.cc

Issue 2494633004: Remove about:srcdoc url conversion. (Closed)
Patch Set: Addressed comments (@creis) Created 4 years, 1 month 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/child_process_security_policy_impl.cc
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
index f1aa1c74d71df72530020a7be37b54ab32fee7f7..a0ee91ac9440d5ff174fe2c1f69f04768faf8304 100644
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -626,8 +626,8 @@ bool ChildProcessSecurityPolicyImpl::CanRequestURL(
return false; // Can't request invalid URLs.
if (IsPseudoScheme(url.scheme())) {
- // Every child process can request <about:blank>.
- if (base::LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL))
+ // Every child process can request <about:blank> and <about:srcdoc>
Charlie Reis 2016/11/23 08:25:21 nit: End with period.
arthursonzogni 2016/11/23 14:39:26 Done.
+ if (url == url::kAboutBlankURL || url == content::kAboutSrcDocURL)
return true;
// URLs like <about:version>, <about:crash>, <view-source:...> shouldn't be
// requestable by any child process. Also, this case covers
@@ -666,7 +666,7 @@ bool ChildProcessSecurityPolicyImpl::CanCommitURL(int child_id,
// Of all the pseudo schemes, only about:blank is allowed to commit.
Charlie Reis 2016/11/23 08:25:20 Do we need to allow about:srcdoc here, or will tha
arthursonzogni 2016/11/23 14:39:26 Good question! CanCommitURL is called inside seve
Charlie Reis 2016/11/23 18:03:37 Glad to hear. In the abstract, yes, about:srcdoc
Charlie Reis 2016/11/24 00:17:00 Nick brings up the point that it's probably saner
if (IsPseudoScheme(url.scheme()))
- return base::LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL);
+ return url == url::kAboutBlankURL;
// Blob and filesystem URLs require special treatment; validate the inner
// origin they embed.

Powered by Google App Engine
This is Rietveld 408576698