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

Unified Diff: chrome/browser/tab_contents/render_view_host_manager.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/new_tab_ui_uitest.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_host_manager.cc
diff --git a/chrome/browser/tab_contents/render_view_host_manager.cc b/chrome/browser/tab_contents/render_view_host_manager.cc
index 888354030b8038d9dc3ddfb2085292aadcc0aa69..664b7f50e94ca0ee1fa2c3f9bbf8bf4b9149002d 100644
--- a/chrome/browser/tab_contents/render_view_host_manager.cc
+++ b/chrome/browser/tab_contents/render_view_host_manager.cc
@@ -310,9 +310,15 @@ bool RenderViewHostManager::ShouldSwapProcessesForNavigation(
// For security, we should transition between processes when one is a DOM UI
// page and one isn't.
Profile* profile = delegate_->GetControllerForRenderManager().profile();
- if (DOMUIFactory::UseDOMUIForURL(profile, cur_entry->url()) !=
- DOMUIFactory::UseDOMUIForURL(profile, new_entry->url()))
- return true;
+ if (DOMUIFactory::UseDOMUIForURL(profile, cur_entry->url())) {
+ // Force swap if it's not an acceptable URL for DOM UI.
+ if (!DOMUIFactory::IsURLAcceptableForDOMUI(profile, new_entry->url()))
+ return true;
+ } else {
+ // Force swap if it's a DOM UI URL.
+ if (DOMUIFactory::UseDOMUIForURL(profile, new_entry->url()))
+ return true;
+ }
// Also, we must switch if one is an extension and the other is not the exact
// same extension.
« no previous file with comments | « chrome/browser/dom_ui/new_tab_ui_uitest.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698