Closed
Bug 881667
Opened 11 years ago
Closed 11 years ago
Expose initialization/shutdown stage to components
Categories
(Toolkit :: Startup and Profile System, defect)
Toolkit
Startup and Profile System
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: Yoric, Assigned: Yoric)
References
Details
(Keywords: dev-doc-needed, Whiteboard: [Async][Async Shutdown])
Attachments
(1 file, 2 obsolete files)
4.57 KB,
patch
|
Yoric
:
review+
|
Details | Diff | Splinter Review |
Bug 845190 is an example of a bug in which we crash because we find ourselves instantiating a component during the shutdown process. I believe that the best way to solve this issue is to expose somewhere the current stage of initialization/shutdown. Attaching a possible API for this.
Attachment #760860 -
Flags: feedback?(benjamin)
Updated•11 years ago
|
Attachment #760860 -
Attachment mime type: text/x-idl → text/plain
Comment 1•11 years ago
|
||
Hmm, why can't you just listen to the notification that interests you? This seems possible to implement on top of an observer.
Assignee | ||
Comment 2•11 years ago
|
||
The issue that causes bug 845190 is actually a component that is (sometimes) instantiated after the notification has been sent, so it's too late to do anything. Now, of course, this API could easily be implemented as an observer.
Comment 3•11 years ago
|
||
(In reply to David Rajchenbach Teller [:Yoric] from comment #2) > The issue that causes bug 845190 is actually a component that is (sometimes) > instantiated after the notification has been sent, so it's too late to do > anything. hm, so the problem there is that the standard gOnceAliveNowDead thing doesn't work because in some odd testing env the stream transport service is never started. I'm not sure it wouldn't be a good idea to just always bring it up fairly late in startup but lets not worry about that now.
Comment 4•11 years ago
|
||
Comment on attachment 760860 [details] Possible API >interface mozIRing { why do you need an interface for this? a global enum / bool seems like it would do just fine. (comment 3 was me trying to say I can't think of a way to avoid storing this state)
Assignee | ||
Comment 5•11 years ago
|
||
Global enum does it for C++. I imagine that it might be useful for JS, too, but I'm willing to start with just a C++ version.
Comment 6•11 years ago
|
||
(In reply to comment #5) > Global enum does it for C++. I imagine that it might be useful for JS, too, but > I'm willing to start with just a C++ version. We should not add APIs just because they might some day be useful for JS. :-)
Comment 7•11 years ago
|
||
1) I think this is good in theory 2) I do not think that this should start as a JS API, because it will be much harder to change once it is exposed to external code. NS_GetRunState is fine for now. 3) There should be a state before XPCOM_STARTUP 4) Remove SESSIONRESTORE_WINDOWS_RESTORED 5) I'm not convinced that any of QUIT_APPLICATION_REQUESTED/QUIT_APPLICATION_GRANTED/QUIT_APPLICATION should be added... their loopy semantics don't quite match the rest of anything. And with those removed, you can safely assert that the "next" runstate is always greater than the previous one. 6) But the xpcom-shutdown-threads state probably should be added. 7) Oh how I hate xpcom-will-shutdown, can we remove it?
Updated•11 years ago
|
Attachment #760860 -
Flags: feedback?(benjamin)
Assignee | ||
Comment 8•11 years ago
|
||
Note that a JS version would be useful right now for bug 921157.
Assignee | ||
Comment 9•11 years ago
|
||
As discussed with bsmedberg over irc, it should be sufficient to provide nsIAppStartup::startingUp and to fix bug 922814.
Assignee: nobody → dteller
Attachment #760860 -
Attachment is obsolete: true
Attachment #812808 -
Flags: review?(justin.lebar+bug)
Assignee | ||
Updated•11 years ago
|
Assignee | ||
Updated•11 years ago
|
Attachment #812808 -
Flags: review?(justin.lebar+bug) → review?(continuation)
Comment 10•11 years ago
|
||
I'm not an XPCOM peer. I can try to figure out what is going on here, or bsmedberg can review it, depending on what he thinks makes sense.
Flags: needinfo?(benjamin)
Comment 11•11 years ago
|
||
I need to review this. It's in the wrong component anyway.
Component: XPCOM → Startup and Profile System
Flags: needinfo?(benjamin)
Product: Core → Toolkit
Updated•11 years ago
|
Attachment #812808 -
Flags: review?(continuation)
Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 812808 [details] [diff] [review] Exposing nsIAppStartup::startingUp Here is one possible implementation. I wanted to ensure that startingUp is available exactly once final-ui-startup is completed, which complicates slightly the code.
Attachment #812808 -
Flags: review?(benjamin)
Assignee | ||
Updated•11 years ago
|
Whiteboard: [Async][Async Shutdown]
Comment 13•11 years ago
|
||
Comment on attachment 812808 [details] [diff] [review] Exposing nsIAppStartup::startingUp + [noscript] void setStartingUp(in boolean aValue); Given the semantics, this should probably instead be [noscript] void doneStartingUp(); Also add a comment explaining that this is called from nsAppRunner.cpp and should not be called from elsewhere. In the impl, assert that mStartupTime is true when the method is called (to verify that it is only called once). r=me with those changes.
Attachment #812808 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 14•11 years ago
|
||
Applied feedback Try: https://tbpl.mozilla.org/?tree=Try&rev=106e931b9c2b
Attachment #812808 -
Attachment is obsolete: true
Attachment #815745 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 15•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/b4f347a62071
Keywords: checkin-needed
Whiteboard: [Async][Async Shutdown] → [Async][Async Shutdown][fixed-in-fx-team]
Comment 16•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b4f347a62071
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [Async][Async Shutdown][fixed-in-fx-team] → [Async][Async Shutdown]
Target Milestone: --- → mozilla27
Assignee | ||
Updated•11 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•