summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.h
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-03 18:43:05 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-03 18:43:05 +0000
commit06b42f03a475d6d907ef3c3b93a5c9635105421a (patch)
tree19852b6a5d539a2d2de87ff986b321d24d5fc4e7 /chrome/browser/browser.h
parent78a5233098227f7382c800d2be847016cc091a8b (diff)
downloadchromium_src-06b42f03a475d6d907ef3c3b93a5c9635105421a.zip
chromium_src-06b42f03a475d6d907ef3c3b93a5c9635105421a.tar.gz
chromium_src-06b42f03a475d6d907ef3c3b93a5c9635105421a.tar.bz2
The onbeforeunload event could be sent more than once to a page.
This would happen if you closed a tab more than once and if you closed the browser several times (while it is waiting for unloads to execute). BUG=5029 TEST=See bug Review URL: http://codereview.chromium.org/13078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.h')
-rw-r--r--chrome/browser/browser.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index bb88bc5..6540c2e 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -440,7 +440,7 @@ class Browser : public TabStripModelDelegate,
// OnBeforeUnload handling //////////////////////////////////////////////////
- typedef std::vector<TabContents*> UnloadListenerVector;
+ typedef std::set<TabContents*> UnloadListenerSet;
// Processes the next tab that needs it's beforeunload/unload event fired.
void ProcessPendingTabs();
@@ -452,10 +452,10 @@ class Browser : public TabStripModelDelegate,
// events since the user cancelled closing the window.
void CancelWindowClose();
- // Removes the tab from the associated vector. Returns whether the tab
- // was in the vector in the first place.
+ // Removes |tab| from the passed |set|.
+ // Returns whether the tab was in the set in the first place.
// TODO(beng): this method needs a better name!
- bool RemoveFromVector(UnloadListenerVector* vector, TabContents* tab);
+ bool RemoveFromSet(UnloadListenerSet* set, TabContents* tab);
// Cleans up state appropriately when we are trying to close the browser and
// the tab has finished firing it's unload handler. We also use this in the
@@ -566,11 +566,11 @@ class Browser : public TabStripModelDelegate,
// Tracks tabs that need there beforeunload event fired before we can
// close the browser. Only gets populated when we try to close the browser.
- UnloadListenerVector tabs_needing_before_unload_fired_;
+ UnloadListenerSet tabs_needing_before_unload_fired_;
// Tracks tabs that need there unload event fired before we can
// close the browser. Only gets populated when we try to close the browser.
- UnloadListenerVector tabs_needing_unload_fired_;
+ UnloadListenerSet tabs_needing_unload_fired_;
// Whether we are processing the beforeunload and unload events of each tab
// in preparation for closing the browser.