Support launching selectable profiles via `--profile` command line option
Categories
(Toolkit :: Startup and Profile System, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox132 | --- | fixed |
People
(Reporter: jhirsch, Assigned: jhirsch)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
The legacy Profile Manager window launches instances using nsAppStartup::CreateInstanceWithProfile(nsIToolkitProfile* aProfile)
. This function triggers an application restart, passing the selected profile via the -P <name>
command line argument. This approach only works for managed profiles, that is, profiles that are listed in profiles.ini. This is because parsing the -P <name>
argument requires finding a profile in the profiles.ini list that has the supplied name
.
Our new selectable profiles will not be listed in profiles.ini, and will also have their own new profile selector window. We need a new method exposed to JS via XPIDL that takes an unmanaged profile as a path, and triggers restart, setting the --profile <path/to/profile/>
command line argument instead.
Aside from adding this new method to nsAppStartup
, there are changes needed in nsToolkitProfileService
as well:
Currently, if a profile is launched via --profile <path>
, and the path does not correspond to a managed profile (that is, it is not found in profiles.ini), we do not look for a localDir, so roaming users lose the benefits of terminal-local caching. (See: https://searchfox.org/mozilla-central/rev/20d128ef2bcaff950172fe46eada6bc74673bd25/toolkit/profile/nsToolkitProfileService.cpp#1417-1423)
To provide good roaming support for selectable profiles, we should therefore also modify the --profile
handling code to check if the rootDir is relative, and if it is, attempt to construct a corresponding relative localDir, then check if that directory exists. If it exists, we should use that as the localDir; if not, we should fall back to using the rootDir (that is, we should give up on finding a separate cache directory). This tracks with how relative vs absolute paths are handled by the toolkitProfileService already.
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Comment 1•2 months ago
|
||
- Add a new method to nsAppStartup that allows launching a new instance
from a profile path, not just from an nsIToolkitProfile.
The nsAppStartup change just adds a JS-callable function that spawns a
new instance using the --profile <path>
command-line option. Note that
we already have an analogous function that spawns a new instance using
the -P <name>
command-line option. This addition is necessary because
profiles not in profiles.ini do not have such a name available,
including the new selectable profiles, but we want to be able to launch
them in response to clicks on new frontend profiles menu items.
- Modify nsToolkitProfileService to allow for roaming profiles passed in
via the "-profile /path/to/profile/" command line option but not
present in profiles.ini.
With this patch, when a profile is supplied via the "-profile
/path/to/profile/" command line option, if the path is not found in
profiles.ini, and if the path is a relative path, then we use the
corresponding local dir, if it exists.
Previously for unmanaged profiles, we would not look for a local dir,
instead just using the root dir to hold the various local ephemeral
caches. This change is necessary to prevent degraded filesystem
performance for roaming / enterprise users who adopt selectable
profiles.
Updated•2 months ago
|
Assignee | ||
Updated•2 months ago
|
Comment 3•1 month ago
|
||
Backed out for causing build bustages in nsToolkitProfileService.cpp
- Backout link
- Push with failures
- Failure Log
- Failure line: /builds/worker/checkouts/gecko/toolkit/profile/nsToolkitProfileService.cpp(2076,26): error: function declared 'stdcall' here was previously declared without calling convention
Assignee | ||
Updated•1 month ago
|
Comment 5•1 month ago
|
||
Backed out for causing bc failure on browser_startup_mainthreadio.js
Assignee | ||
Comment 7•29 days ago
|
||
Here's the bug in question with the mainthreadio failure, see comment 5
Assignee | ||
Comment 8•28 days ago
|
||
Running into some windows build errors locally, so I've pushed the latest iteration to Try:
https://treeherder.mozilla.org/jobs?repo=try&revision=26cb17a8410f3db5458ddf4636adee8c8b1fb9bf
If this job completes successfully, I'll reland.
Comment 10•26 days ago
|
||
bugherder |
Description
•