Closed
Bug 911146
Opened 12 years ago
Closed 12 years ago
nsIAppStartup should be able to tell whether the app was restarted
Categories
(Toolkit :: Startup and Profile System, defect)
Toolkit
Startup and Profile System
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: ttaubert, Assigned: ttaubert)
References
Details
(Keywords: dev-doc-needed)
Attachments
(1 file, 2 obsolete files)
|
4.59 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
It would be great if nsIAppStartup had a 'wasRestarted' flag that we could use to tell whether the current startup is the one following a restart.
http://hg.mozilla.org/mozilla-central/file/c7459bc8e449/xpcom/ds/TimeStamp.cpp#l60
TimeStamp has its own implementation. SessionStore does something similar (it sets a pref that is reset on next startup) to resume the session automatically.
http://hg.mozilla.org/mozilla-central/file/065727546e13/browser/components/sessionstore/src/SessionStore.jsm#l1025
| Assignee | ||
Comment 1•12 years ago
|
||
Sorry, not sure who to ask for feedback.
Attachment #797803 -
Flags: feedback?(dtownsend+bugmail)
Attachment #797803 -
Flags: feedback?(benjamin)
Updated•12 years ago
|
Attachment #797803 -
Flags: feedback?(dtownsend+bugmail) → feedback+
Comment 2•12 years ago
|
||
Comment on attachment 797803 [details] [diff] [review]
add nsIAppStartup.wasRestarted
I think the IDL comment needs to be more specific: that this is a restart initiated via the eRestart flag. It isn't for "the user shut down the app and restarted it" ;-)
Do we have any tests for this mess?
Attachment #797803 -
Flags: feedback?(benjamin) → feedback+
| Assignee | ||
Comment 3•12 years ago
|
||
This patch clarifies comments in the IDL file and also adds a 'willRestart' attribute. That turned out to be a helpful addition to 'shuttingDown' especially for SessionStore.
Unfortunately I don't think that there's a way to test this stuff. I couldn't find any tests calling nsIAppStartup.quit() and I don't think any of our test suites supports that.
We could maybe ask the MozMill folks and check if they would like to write a test in a follow-up?
Assignee: nobody → ttaubert
Attachment #797803 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #801463 -
Flags: review?(dtownsend+bugmail)
Attachment #801463 -
Flags: review?(benjamin)
Updated•12 years ago
|
Attachment #801463 -
Flags: review?(benjamin) → review+
| Assignee | ||
Updated•12 years ago
|
Attachment #801463 -
Flags: review?(dtownsend+bugmail)
| Assignee | ||
Comment 4•12 years ago
|
||
Wow, just as I wanted to land this I saw some UUID conflict caused by bug 882142. Turns out that .restarting is now implemented already.
Depends on: 882142
| Assignee | ||
Comment 5•12 years ago
|
||
Landed without the .willRestart attribute:
https://hg.mozilla.org/integration/fx-team/rev/4c2ec5c33ea9
| Assignee | ||
Updated•12 years ago
|
Keywords: dev-doc-needed
| Assignee | ||
Comment 6•12 years ago
|
||
Backed out for lots of breakage:
https://hg.mozilla.org/integration/fx-team/rev/51fbc6fcec35
| Assignee | ||
Comment 7•12 years ago
|
||
It seems that the nsIAppStartup service isn't available that early in the startup phase when we would set sProcessCreation in xpcom/ds/TimeStamp.cpp.
The environment variable would be available immediately, and unset after reading it once. Looks like we'll have to introduce a second env variable and leave the TimeStamp code untouched.
| Assignee | ||
Comment 8•12 years ago
|
||
Same patch without only minimal TimeStamp.cpp changes.
Attachment #801463 -
Attachment is obsolete: true
Attachment #802948 -
Flags: review?(benjamin)
| Assignee | ||
Comment 9•12 years ago
|
||
Updated•12 years ago
|
Attachment #802948 -
Flags: review?(benjamin) → review+
| Assignee | ||
Comment 10•12 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Comment 11•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•