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

Unified Diff: chrome/renderer/render_thread.cc

Issue 5268006: Changing the security model for "chrome" URLs... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/common/chrome_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_thread.cc
===================================================================
--- chrome/renderer/render_thread.cc (revision 71345)
+++ chrome/renderer/render_thread.cc (working copy)
@@ -870,12 +870,18 @@
WebScriptController::enableV8SingleThreadMode();
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
// chrome: pages should not be accessible by normal content, and should
// also be unable to script anything but themselves (to help limit the damage
// that a corrupt chrome: page could cause).
WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme));
- WebSecurityPolicy::registerURLSchemeAsLocal(chrome_ui_scheme);
- WebSecurityPolicy::registerURLSchemeAsNoAccess(chrome_ui_scheme);
+ if (command_line.HasSwitch(switches::kNewChromeUISecurityModel)) {
+ WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme);
+ } else {
+ WebSecurityPolicy::registerURLSchemeAsLocal(chrome_ui_scheme);
+ WebSecurityPolicy::registerURLSchemeAsNoAccess(chrome_ui_scheme);
+ }
// chrome-extension: resources shouldn't trigger insecure content warnings.
WebString extension_scheme(ASCIIToUTF16(chrome::kExtensionScheme));
@@ -894,8 +900,6 @@
if (search_extension)
RegisterExtension(search_extension, false);
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-
if (command_line.HasSwitch(switches::kEnableBenchmarking))
RegisterExtension(extensions_v8::BenchmarkingExtension::Get(), false);
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698