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

Unified Diff: chrome/browser/child_process_security_policy.cc

Issue 150207: Foundations for Print Preview and Setup... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.cc ('k') | chrome/browser/dom_ui/dom_ui_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/child_process_security_policy.cc
===================================================================
--- chrome/browser/child_process_security_policy.cc (revision 19905)
+++ chrome/browser/child_process_security_policy.cc (working copy)
@@ -98,6 +98,7 @@
RegisterPseudoScheme(chrome::kAboutScheme);
RegisterPseudoScheme(chrome::kJavaScriptScheme);
RegisterPseudoScheme(chrome::kViewSourceScheme);
+ RegisterPseudoScheme(chrome::kPrintScheme);
}
ChildProcessSecurityPolicy::~ChildProcessSecurityPolicy() {
@@ -170,10 +171,11 @@
return; // The scheme has already been white-listed for every renderer.
if (IsPseudoScheme(url.scheme())) {
- // The view-source scheme is a special case of a pseudo URL that eventually
- // results in requesting its embedded URL.
- if (url.SchemeIs(chrome::kViewSourceScheme)) {
- // URLs with the view-source scheme typically look like:
+ // The view-source and print schemes are a special case of a pseudo URL that
+ // eventually results in requesting its embedded URL.
+ if (url.SchemeIs(chrome::kViewSourceScheme) ||
+ url.SchemeIs(chrome::kPrintScheme)) {
+ // URLs with the view-source and print schemes typically look like:
// view-source:http://www.google.com/a
// In order to request these URLs, the renderer needs to be able to
// request the embedded URL.
@@ -254,9 +256,10 @@
if (IsPseudoScheme(url.scheme())) {
// There are a number of special cases for pseudo schemes.
- if (url.SchemeIs(chrome::kViewSourceScheme)) {
- // A view-source URL is allowed if the renderer is permitted to request
- // the embedded URL.
+ if (url.SchemeIs(chrome::kViewSourceScheme) ||
+ url.SchemeIs(chrome::kPrintScheme)) {
+ // View-source and print URL's are allowed if the renderer is permitted
+ // to request the embedded URL.
return CanRequestURL(renderer_id, GURL(url.path()));
}
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.cc ('k') | chrome/browser/dom_ui/dom_ui_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698