summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-16 20:37:26 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-16 20:37:26 +0000
commit1d20a587d6339869b4ad9aaac0182e741eb73e59 (patch)
tree5d7b7f94ec1361fe0cb40a9cdd69019e1d01b994
parent90c67a3e0dfd6d07e5eef3414be49a3ce9374b96 (diff)
downloadchromium_src-1d20a587d6339869b4ad9aaac0182e741eb73e59.zip
chromium_src-1d20a587d6339869b4ad9aaac0182e741eb73e59.tar.gz
chromium_src-1d20a587d6339869b4ad9aaac0182e741eb73e59.tar.bz2
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
-rw-r--r--chrome/browser/views/browser_actions_container.cc6
1 files 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() {