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

Unified Diff: chrome/browser/dom_ui/dom_ui_factory.cc

Issue 4862002: Prevent a crash when visiting about:hang in two NTPs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indent Created 10 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
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_factory.h ('k') | chrome/browser/dom_ui/new_tab_ui_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/dom_ui_factory.cc
diff --git a/chrome/browser/dom_ui/dom_ui_factory.cc b/chrome/browser/dom_ui/dom_ui_factory.cc
index fbdb42bea8110fec7968d6901a651d43a16c4a14..d27329e33818886b4766a55bf90db593d409d8f9 100644
--- a/chrome/browser/dom_ui/dom_ui_factory.cc
+++ b/chrome/browser/dom_ui/dom_ui_factory.cc
@@ -234,6 +234,20 @@ bool DOMUIFactory::UseDOMUIForURL(Profile* profile, const GURL& url) {
}
// static
+bool DOMUIFactory::IsURLAcceptableForDOMUI(Profile* profile, const GURL& url) {
+ return UseDOMUIForURL(profile, url) ||
+ // javacsript: URLs are allowed to run in DOM UI pages
+ url.SchemeIs(chrome::kJavaScriptScheme) ||
+ // It's possible to load about:blank in a DOM UI renderer.
+ // See http://crbug.com/42547
+ url.spec() == chrome::kAboutBlankURL ||
+ // about:crash, about:hang, and about:shorthang are allowed.
+ url.spec() == chrome::kAboutCrashURL ||
+ url.spec() == chrome::kAboutHangURL ||
+ url.spec() == chrome::kAboutShorthangURL;
+}
+
+// static
DOMUI* DOMUIFactory::CreateDOMUIForURL(TabContents* tab_contents,
const GURL& url) {
DOMUIFactoryFunction function = GetDOMUIFactoryFunction(
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_factory.h ('k') | chrome/browser/dom_ui/new_tab_ui_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698