I'm splitting this out from bug 358689, leaving that one for adding UI to let users avoid crash loops. This is the portion that actually does the periodic auto-saving, which we can go ahead with now since it's a hidden pref, so the people turning it on can know to go nuke the file if they get into a bad state.
Created attachment 248398 [details] [diff] [review] fix Saves periodically, coalescing events for 60 seconds before writing to disk. Doing it this way should also reduce the chance of getting a bad state saved, since we won't usually be saving just as a page loads. Also fixes a typo I noticed in a dictionary key. Once this lands anyone using the session-saving pref will, one time only, have their saved session open with all their bookmark bars hidden. It's still a hidden pref and that's a pretty minor issue, so I'd much rather do that than add migrating code that only a handful of early-adopters will need.
Sorry about that. Mouse slipped when CCing myself.
Comment on attachment 248398 [details] [diff] [review] fix >+// Notifies the SessionManager that the windows state has changed. This s/windows/window r=me with that change, code-wise. I didn't test, though.
Comment on attachment 248398 [details] [diff] [review] fix I'll fix the typo on checkin.
Oh, I meant to ask this earlier...does this patch address the problem raised by bug 361092? cl
Comment on attachment 248398 [details] [diff] [review] fix sr=pink
Checked in on trunk and MOZILLA_1_8_BRANCH.