diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-06 00:37:22 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-06 00:37:22 +0000 |
commit | c755d94a4040d5bbad69b72ad78a1251334851e6 (patch) | |
tree | 01ce317b085f672129ae396a52d84ce2262daafd /chrome | |
parent | 401e2c1d153d188e1876702508e640714b9f6e81 (diff) | |
download | chromium_src-c755d94a4040d5bbad69b72ad78a1251334851e6.zip chromium_src-c755d94a4040d5bbad69b72ad78a1251334851e6.tar.gz chromium_src-c755d94a4040d5bbad69b72ad78a1251334851e6.tar.bz2 |
Fix for bug where reloading an extension from an infobar when another window does not have that infobar open but has another crashed extension's infobar hoses the browser. Phew.
BUG=34683
TEST=follow repro steps in bug. should not crash.
Review URL: http://codereview.chromium.org/572045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 0a652d4..97eabe8 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -2435,15 +2435,16 @@ void Browser::Observe(NotificationType type, if (!tab_contents) break; Extension* extension = Details<Extension>(details).ptr(); - int delegate_count = tab_contents->infobar_delegate_count(); CrashedExtensionInfoBarDelegate* delegate = NULL; - for (int i = 0; i < delegate_count; ++i) { + for (int i = 0; i < tab_contents->infobar_delegate_count();) { delegate = tab_contents->GetInfoBarDelegateAt(i)-> AsCrashedExtensionInfoBarDelegate(); - if (!delegate) - continue; - if (extension->id() == delegate->extension_id()) + if (delegate && delegate->extension_id() == extension->id()) { tab_contents->RemoveInfoBar(delegate); + continue; + } + // Only increment |i| if we didn't remove an entry. + ++i; } break; } |