diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 07:07:18 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 07:07:18 +0000 |
commit | 42599f8282ae724f2aec50ff4ac91bebbc0451e6 (patch) | |
tree | 47b890c20f519b5800cb093c38dd5c4a867c07bd /chrome/browser/browser_list.cc | |
parent | 5f794c15856aaa57b8b84f3bb89f2f744447ed23 (diff) | |
download | chromium_src-42599f8282ae724f2aec50ff4ac91bebbc0451e6.zip chromium_src-42599f8282ae724f2aec50ff4ac91bebbc0451e6.tar.gz chromium_src-42599f8282ae724f2aec50ff4ac91bebbc0451e6.tar.bz2 |
Make sure the download status in the application icon is updated
when an incognito window is closed.
This also avoids crash described in
http://code.google.com/p/chromium/issues/detail?id=56722#c12
We need to remove the half-destroyed Browser from BrowserList
before we start iterating over BrowserList when updating
the application icon.
BUG=48391
TEST=see bug
Review URL: http://codereview.chromium.org/3719004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62377 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_list.cc')
-rw-r--r-- | chrome/browser/browser_list.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/browser_list.cc b/chrome/browser/browser_list.cc index 31e09cc..0803db5 100644 --- a/chrome/browser/browser_list.cc +++ b/chrome/browser/browser_list.cc @@ -177,15 +177,15 @@ void BrowserList::RemoveBrowser(Browser* browser) { NotificationType::BROWSER_CLOSED, Source<Browser>(browser), Details<bool>(&closing_last_browser)); - // Send out notifications before anything changes. Do some basic checking to - // try to catch evil observers that change the list from under us. + RemoveBrowserFrom(browser, &browsers_); + + // Do some basic checking to try to catch evil observers + // that change the list from under us. size_t original_count = observers_.size(); - FOR_EACH_OBSERVER(Observer, observers_, OnBrowserRemoving(browser)); + FOR_EACH_OBSERVER(Observer, observers_, OnBrowserRemoved(browser)); DCHECK_EQ(original_count, observers_.size()) << "observer list modified during notification"; - RemoveBrowserFrom(browser, &browsers_); - // If the last Browser object was destroyed, make sure we try to close any // remaining dependent windows too. if (browsers_.empty()) { |