summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_modal_dialog_queue.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 03:51:50 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 03:51:50 +0000
commit1e1baa489c6fc202c8516707dd5ca2d4738920b9 (patch)
tree060270c7656e935cfdb0aaa1cea4d48cc8626611 /chrome/browser/app_modal_dialog_queue.h
parentc1f50aa589d83b9725d4b7f19559eb94c006d818 (diff)
downloadchromium_src-1e1baa489c6fc202c8516707dd5ca2d4738920b9.zip
chromium_src-1e1baa489c6fc202c8516707dd5ca2d4738920b9.tar.gz
chromium_src-1e1baa489c6fc202c8516707dd5ca2d4738920b9.tar.bz2
Fixes two bugs in cookie prompting:
. In certain situations we could crash because we weren't letting CookiePromptView::Init complete and then attempting to reference some NULL fields. I've fixed this by adding AppModalDialog::IsValid and moving the logic that was in Init to IsValid. This way we only create CookiePromptView when needed. . We were leaking AppModalDialogs. I've made CookiePromptView own the AppModalDialog and delete it when the CookiePromptView is deleted. BUG=36079 TEST=enable prompting for cookies, go to a bunch of sites make sure you don't crash. Review URL: http://codereview.chromium.org/632006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_modal_dialog_queue.h')
-rw-r--r--chrome/browser/app_modal_dialog_queue.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/app_modal_dialog_queue.h b/chrome/browser/app_modal_dialog_queue.h
index aa169c5..66ba3ff 100644
--- a/chrome/browser/app_modal_dialog_queue.h
+++ b/chrome/browser/app_modal_dialog_queue.h
@@ -54,11 +54,17 @@ class AppModalDialogQueue {
private:
friend struct DefaultSingletonTraits<AppModalDialogQueue>;
- AppModalDialogQueue() : active_dialog_(NULL) { }
+ AppModalDialogQueue() : active_dialog_(NULL) {}
// Shows |dialog| and notifies the BrowserList that a modal dialog is showing.
void ShowModalDialog(AppModalDialog* dialog);
+ // Returns the next dialog to show. This removes entries from
+ // app_modal_dialog_queue_ until one is valid or the queue is empty. This
+ // returns NULL if there are no more dialogs, or all the dialogs in the queue
+ // are not valid.
+ AppModalDialog* GetNextDialog();
+
// Contains all app modal dialogs which are waiting to be shown, with the
// currently modal dialog at the front of the queue.
std::queue<AppModalDialog*> app_modal_dialog_queue_;