Deprecate FileUtils.getDir(..., ..., true) during startup/shutdown
Categories
(Toolkit :: General, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: Yoric, Assigned: kenrick95, Mentored)
References
Details
(Whiteboard: [Async:ready][lang=js])
Attachments
(1 file)
Comment 1•11 years ago
|
||
Reporter | ||
Comment 2•11 years ago
|
||
Reporter | ||
Comment 3•11 years ago
|
||
Reporter | ||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Updated•11 years ago
|
Comment 6•11 years ago
|
||
Reporter | ||
Comment 8•11 years ago
|
||
Comment 9•11 years ago
|
||
Updated•10 years ago
|
Assignee | ||
Comment 10•4 years ago
|
||
Hi, this looks interesting and would like to try it out.
May I confirm if now the required things to do is to only add Deprecate.warning
call in FileUtils.getDir
when the 3rd parameter (shouldCreate
) is passed as true
? Do I need to handle calling Deprecate.warning
only during startup/shutdown? If so, since bug 881667 has been closed, what's the recommended way to know whether it is called during startup/shutdown?
Thanks :)
Reporter | ||
Comment 11•4 years ago
|
||
That's great :)
May I confirm if now the required things to do is to only add Deprecate.warning call in FileUtils.getDir when the 3rd parameter (shouldCreate) is passed as true?
Exactly.
Do I need to handle calling Deprecate.warning only during startup/shutdown?
Indeed.
If so, since bug 881667 has been closed, what's the recommended way to know whether it is called during startup/shutdown?
Well, it has been closed because it has been fixed :)
These days, the simplest way to know whether we're during startup is to call nsIAppStartup
.
Something like
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup);
if (appStartup.startingUp) {
// We're starting up.
}
if (appStartup.shuttingDown) {
// We're shutting down.
}
Assignee | ||
Comment 12•4 years ago
|
||
Got it!
I think I would be able to send a patch soon. But to make sure, how do you suggest to test this behavior?
Thanks
Assignee | ||
Comment 13•4 years ago
|
||
Because passing true to the 3rd parameter (shouldCreate)
causes main thread I/O and should be avoided
especially during startup/shutdown
Updated•4 years ago
|
Reporter | ||
Comment 14•4 years ago
|
||
Unfortunately, I don't see any good way to test this. Let's first test that it doesn't break anything :)
Reporter | ||
Comment 15•4 years ago
|
||
Florian, do you have any idea on how we could test this?
Comment 16•4 years ago
|
||
Do you want a test to verify that the deprecation warning has been emitted, or a test to ensure this is not being used during startup/shutdown?
I think you could have Deprecated.jsm add profiler markers that should be possible to access during startup tests.
Reporter | ||
Comment 17•4 years ago
|
||
Do you want a test to verify that the deprecation warning has been emitted, or a test to ensure this is not being used during startup/shutdown?
The former for the time being.
I think you could have Deprecated.jsm add profiler markers that should be possible to access during startup tests.
Could you mentor kenrick95 on this?
Reporter | ||
Comment 18•4 years ago
|
||
Well, let's start with checking that it doesn't break anything:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=aad90e155d4d47b931a0c63f7524bb9339492c9a
Reporter | ||
Comment 19•4 years ago
|
||
It seems to work, so let's land it.
Comment 20•4 years ago
|
||
Comment 21•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 22•4 years ago
|
||
Should this bug get flagged with the "Perf" key word?
Description
•