Closed
Bug 306375
Opened 19 years ago
Closed 19 years ago
Make it possible to restart to a different profile
Categories
(Toolkit :: Startup and Profile System, defect)
Toolkit
Startup and Profile System
Tracking
()
VERIFIED
FIXED
mozilla1.8beta4
People
(Reporter: darin.moz, Assigned: darin.moz)
Details
(Keywords: fixed1.8)
Attachments
(4 files)
|
3.26 KB,
patch
|
benjamin
:
first-review-
|
Details | Diff | Splinter Review |
|
3.34 KB,
patch
|
benjamin
:
first-review-
benjamin
:
approval1.8b4-
|
Details | Diff | Splinter Review |
|
2.36 KB,
patch
|
benjamin
:
first-review+
|
Details | Diff | Splinter Review |
|
3.64 KB,
patch
|
asa
:
approval1.8b4+
|
Details | Diff | Splinter Review |
Make it possible to restart to a different profile I think the easiest way to solve this is to change the code that sets the XRE_PROFILE_PATH env var to only set that variable if it is not already set. Note to self: one concern with this approach is how it may impact profile selection.
| Assignee | ||
Updated•19 years ago
|
Severity: normal → major
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8beta4
| Assignee | ||
Comment 1•19 years ago
|
||
This is a pretty straightforward patch. I verified it by entering the
following commands into the JS console:
Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment).set("XRE_PROFILE_PATH",
"/tmp/foo")
Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(Components.interfaces.nsIAppStartup).quit(0x12)
The first command changes the XRE_PROFILE_PATH environment variable to
reference a different profile directory, and the second causes Firefox to
restart.
I also verified that normal profile selection, -P, -profile, etc. all continue
to function as expected.
Attachment #194489 -
Flags: first-review?(benjamin)
Comment 2•19 years ago
|
||
Comment on attachment 194489 [details] [diff] [review] v1 patch + file->GetNativePath(path); + PR_SetEnv(expr); nsIEnvironment maybe? That one works for unicode strings, at least interface-wise.
| Assignee | ||
Comment 3•19 years ago
|
||
XPCOM is not running when we need to set these environment variables, so nsIEnvironment isn't an option. As for Unicode support, nsEnvironment just converts the Unicode string to the native filesystem encoding, which is what GetNativePath returns anyways. So, there isn't any advantage to using it. Perhaps one day nsEnvironment might be implemented on windows to use SetEnvironmentVariableW, and then maybe it would make sense to share the code, but again there is the "XPCOM not running" problem.
Comment 4•19 years ago
|
||
Comment on attachment 194489 [details] [diff] [review] v1 patch - static char kEnvVar3[MAXPATHLEN]; + static char kEnvVar[MAXPATHLEN]; sprintf(kEnvVar3, "XRE_BINARY_PATH=%s", gBinaryPath); Does this build? Where is kEnvVar3 declared?
Attachment #194489 -
Flags: first-review?(benjamin) → first-review-
| Assignee | ||
Comment 5•19 years ago
|
||
> Does this build? Where is kEnvVar3 declared?
That was a typo. Is that the only reason for marking this review minus?| Assignee | ||
Comment 7•19 years ago
|
||
Ok, this version went in on the trunk. I'd really like to get this in on the 1.8 branch as well. It's very low risk for Firefox, yet essential for an extension that is being developed.
Attachment #194561 -
Flags: first-review+
Attachment #194561 -
Flags: approval1.8b4?
| Assignee | ||
Comment 8•19 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 9•19 years ago
|
||
can we get this verified on the trunk. Ben, can you give us information about the risk here?
Comment 10•19 years ago
|
||
Comment on attachment 194561 [details] [diff] [review] v1.1 patch actually... this does not obey the PR_GetEnv API: you must treat an empty string the same as a null response: so the proper code would be char *temp = PR_GetEnv("ENVVAR"); if (!temp || !*temp) SaveFileToEnv(...)
Attachment #194561 -
Flags: first-review-
Attachment #194561 -
Flags: first-review+
Attachment #194561 -
Flags: approval1.8b4?
Attachment #194561 -
Flags: approval1.8b4-
| Assignee | ||
Comment 12•19 years ago
|
||
Comment 13•19 years ago
|
||
Comment on attachment 194582 [details] [diff] [review] followup patch Asa, this is quite safe, given a little bit of trunk testing.
Attachment #194582 -
Flags: first-review?(benjamin) → first-review+
| Assignee | ||
Updated•19 years ago
|
Attachment #194584 -
Flags: approval1.8b4?
| Assignee | ||
Comment 15•19 years ago
|
||
(In reply to comment #14) > Verify on trunk and we'll approve branch. I believe it works properly on the trunk. We know of no regressions caused by this patch, so I think it is safe to take this on the branch.
Updated•19 years ago
|
Attachment #194584 -
Flags: approval1.8b4? → approval1.8b4+
Comment 16•19 years ago
|
||
time is short for beta so if this is gonna make the branch, it needs to land ASAP.
Status: RESOLVED → VERIFIED
Component: XRE Startup → Startup and Profile System
QA Contact: nobody → startup
You need to log in
before you can comment on or make changes to this bug.
Description
•