diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-01 16:29:39 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-01 16:29:39 +0000 |
commit | e6634c458e7602c446c91cda0fc34a6e672f75fc (patch) | |
tree | a2a2c151a8715035e90b044ac7f74361d402920c | |
parent | ebecfb068bcfc514f5d4310acd6b6b5b9c772a77 (diff) | |
download | chromium_src-e6634c458e7602c446c91cda0fc34a6e672f75fc.zip chromium_src-e6634c458e7602c446c91cda0fc34a6e672f75fc.tar.gz chromium_src-e6634c458e7602c446c91cda0fc34a6e672f75fc.tar.bz2 |
Adds some debugging to figure out if TabStrip is being passed invalid index
Syzy says we're accessing beyond the size of TabStrip::tabs_. This
adds some code in hopes of isolating that.
BUG=294353
TEST=none
R=ben@chromium.org
Review URL: https://codereview.chromium.org/25021007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226247 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/tabs/tab_strip.cc | 3 | ||||
-rw-r--r-- | ui/views/view_model.cc | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc index 6aedb9b..e4f195c 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -388,7 +388,7 @@ void BrowserTabStripController::TabInsertedAt(WebContents* contents, int model_index, bool is_active) { DCHECK(contents); - DCHECK(model_->ContainsIndex(model_index)); + CHECK(model_->ContainsIndex(model_index)); AddTab(contents, model_index, is_active); } diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 5e40997..f4b8cfb 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -1638,6 +1638,7 @@ Tab* TabStrip::CreateTab() { } void TabStrip::StartInsertTabAnimation(int model_index) { + CHECK_LT(model_index, tabs_.view_size()); PrepareForAnimation(); // The TabStrip can now use its entire width to lay out Tabs. @@ -1645,7 +1646,7 @@ void TabStrip::StartInsertTabAnimation(int model_index) { available_width_for_tabs_ = -1; GenerateIdealBounds(); - + CHECK_LT(model_index, tabs_.view_size()); Tab* tab = tab_at(model_index); if (model_index == 0) { tab->SetBounds(0, ideal_bounds(model_index).y(), 0, diff --git a/ui/views/view_model.cc b/ui/views/view_model.cc index 5f492f5..c6b4672 100644 --- a/ui/views/view_model.cc +++ b/ui/views/view_model.cc @@ -17,8 +17,8 @@ ViewModel::~ViewModel() { } void ViewModel::Add(View* view, int index) { - DCHECK_LE(index, static_cast<int>(entries_.size())); - DCHECK_GE(index, 0); + CHECK_LE(index, static_cast<int>(entries_.size())); + CHECK_GE(index, 0); Entry entry; entry.view = view; entries_.insert(entries_.begin() + index, entry); |