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

Unified Diff: chrome/browser/ui/tab_contents/tab_contents_wrapper.cc

Issue 7069006: Prevent registerProtocolHandler for pseudo-schemes and disabled schemes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
index faec87b0e7abef671f583c5cef00160f2496d713..ba5990b0b5bb92f1dd78424bffc68f25cc8fa321 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
@@ -430,10 +430,15 @@ void TabContentsWrapper::OnJSOutOfMemory() {
void TabContentsWrapper::OnRegisterProtocolHandler(const std::string& protocol,
const GURL& url,
const string16& title) {
+ ChildProcessSecurityPolicy* policy =
+ ChildProcessSecurityPolicy::GetInstance();
tony 2011/05/25 17:42:59 Nit: 4 space indent when wrapping
koz (OOO until 15th September) 2011/05/25 21:40:12 Done.
+ if (policy->IsPseudoScheme(protocol) || policy->IsDisabledScheme(protocol))
+ return;
+
ProtocolHandlerRegistry* registry = profile()->GetProtocolHandlerRegistry();
- if (!registry->enabled()) {
+ if (!registry->enabled())
return;
- }
+
ProtocolHandler handler =
ProtocolHandler::CreateProtocolHandler(protocol, url, title);
if (!handler.IsEmpty() &&
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698