Open Bug 789701 Opened 12 years ago Updated 2 years ago

SessionStore does not dispatch SSWindowClosing event on quit-application-requested

Categories

(Firefox :: Session Restore, defect)

defect

Tracking

()

People

(Reporter: nmaier, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

When closing a window SessionStore will dispatch SSIWindowClosing event so that consumers like add-ons may listen to to bring their state in order before the window state is frozen and persisted a last time:
http://mxr.mozilla.org/mozilla-central/source/browser/components/sessionstore/src/SessionStore.jsm#821

However, there is no such event dispatched if the window goes away because the user quits the application:
http://mxr.mozilla.org/mozilla-central/source/browser/components/sessionstore/src/SessionStore.jsm#889

STR:
- Have some code (an add-on) listening to SSWindowClosing
- Open two windows
- Close one of these windows
-> SSWindowClosing is observed
- Quit the browser with the other window still open
-> No event observed

Expected:
-> SSWindowClosing is dispatched and can be observed for the second window as well.
Assignee: nobody → michaelkohler
Attached patch Patch v1 (obsolete) — Splinter Review
Attachment #740027 - Flags: review?(ttaubert)
Attached patch Patch v2Splinter Review
Attachment #740027 - Attachment is obsolete: true
Attachment #740027 - Flags: review?(ttaubert)
Attachment #740029 - Flags: review?(ttaubert)
Comment on attachment 740029 [details] [diff] [review]
Patch v2

Review of attachment 740029 [details] [diff] [review]:
-----------------------------------------------------------------

I don't see the issue mentioned in this bug. I can open one window and quit and see one SSWindowClosing event dispatched. If I open two windows and quit I receive two SSWindowClosing events. This is on Linux.

::: browser/components/sessionstore/src/SessionStore.jsm
@@ +944,5 @@
>     */
>    onQuitApplicationRequested: function ssi_onQuitApplicationRequested() {
> +    // notify that the session store will stop tracking this window so that
> +    // extensions can store any data about this window in session store before
> +    // that's not possible anymore

quit-application-requested doesn't seem like the right place to do it because we could still be kept alive by some observer.
Attachment #740029 - Flags: review?(ttaubert)
Assignee: mkohler → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: