diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 21:22:30 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 21:22:30 +0000 |
commit | 7e58cb27d8563d4c04016ce1e6fb46744acb9330 (patch) | |
tree | 81a63e6563077770718804d649f2464633291c7e | |
parent | 4e941444e96c7c1748456ea7643d91829f1ccc4f (diff) | |
download | chromium_src-7e58cb27d8563d4c04016ce1e6fb46744acb9330.zip chromium_src-7e58cb27d8563d4c04016ce1e6fb46744acb9330.tar.gz chromium_src-7e58cb27d8563d4c04016ce1e6fb46744acb9330.tar.bz2 |
cros: Fix crash when clicking on discarded tab
In out of memory conditions Chrome OS R19 will "discard" tabs that have not been recently used. The page is reloaded when the user selects the tab in the tab strip. We're seeing occasional crashes in the field in the tab reload code due to null site instance pointers in the navigation controller. This might have been caused by crrev.com/120007 which added the use of site instance. I have no in-house repro for this crash but I have a user who can trigger it reliably -- we'll see if this patch helps her.
BUG=119068
TEST=crash reports should go down
Review URL: https://chromiumcodereview.appspot.com/9802047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129940 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/tab_contents/navigation_controller_impl.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/content/browser/tab_contents/navigation_controller_impl.cc b/content/browser/tab_contents/navigation_controller_impl.cc index 3de187b..dbdc940 100644 --- a/content/browser/tab_contents/navigation_controller_impl.cc +++ b/content/browser/tab_contents/navigation_controller_impl.cc @@ -281,7 +281,10 @@ void NavigationControllerImpl::ReloadInternal(bool check_for_repost, // the reload must happen in a new process. // The new entry must have a new page_id and site instance, so it behaves // as new navigation (which happens to clear forward history). - if (site_instance->HasWrongProcessForURL(entry->GetURL())) { + // Tabs that are discarded due to low memory conditions may not have a site + // instance, and should not be treated as a cross-site reload. + if (site_instance && + site_instance->HasWrongProcessForURL(entry->GetURL())) { // Create a navigation entry that resembles the current one, but do not // copy page id, site instance, and content state. NavigationEntryImpl* nav_entry = NavigationEntryImpl::FromNavigationEntry( |