From 1d20a587d6339869b4ad9aaac0182e741eb73e59 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Mon, 16 Aug 2010 20:37:26 +0000 Subject: I've gotten multiple crashes at shutdown due to my new DCHECKs. It seems it's possible to hit them with invalid button IDs. While the DCHECKs won't happen in release builds, what probably will happen is some sort of other problem due to invalid memory access. So just convert the DCHECKs to conditionals. BUG=none TEST=none Review URL: http://codereview.chromium.org/3155018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56226 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/browser_actions_container.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chrome/browser/views/browser_actions_container.cc b/chrome/browser/views/browser_actions_container.cc index 8a86ac6..da95c8b 100644 --- a/chrome/browser/views/browser_actions_container.cc +++ b/chrome/browser/views/browser_actions_container.cc @@ -179,14 +179,12 @@ void BrowserActionButton::Observe(NotificationType type, bool BrowserActionButton::IsPopup() { int tab_id = panel_->GetCurrentTabId(); - DCHECK_GE(tab_id, 0); - return browser_action_->HasPopup(tab_id); + return (tab_id < 0) ? false : browser_action_->HasPopup(tab_id); } GURL BrowserActionButton::GetPopupUrl() { int tab_id = panel_->GetCurrentTabId(); - DCHECK_GE(tab_id, 0); - return browser_action_->GetPopupUrl(tab_id); + return (tab_id < 0) ? GURL() : browser_action_->GetPopupUrl(tab_id); } bool BrowserActionButton::Activate() { -- cgit v1.1