summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 17:03:18 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 17:03:18 +0000
commitb4bed3ec9c9438570ed3a2253aa1a41bf7c7f394 (patch)
tree3c7fc65ed783dffd9e3e1602552e76a488772239
parent013d04eaea2b3e1b9ce4b19820caf5a40c162808 (diff)
downloadchromium_src-b4bed3ec9c9438570ed3a2253aa1a41bf7c7f394.zip
chromium_src-b4bed3ec9c9438570ed3a2253aa1a41bf7c7f394.tar.gz
chromium_src-b4bed3ec9c9438570ed3a2253aa1a41bf7c7f394.tar.bz2
Merge 129940 - 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 TBR=jamescook@chromium.org Review URL: https://chromiumcodereview.appspot.com/9968046 git-svn-id: svn://svn.chromium.org/chrome/branches/1084/src@130150 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/tab_contents/navigation_controller_impl.cc5
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(