зеркало из https://github.com/mozilla/gecko-dev.git
5f16fc9dc3
The current code is a bit of a mess. This patch does the following. - Changes the processing from backwards to forwards. This avoids the need for all the `found` booleans, because if a flag is present multiple times, the last one will naturally override. - Tightens up the checking. It now doesn't use assertions, but instead returns false if any of the options are missing arguments, or have malformed arguments, or any of the mandatory flags are missing. (It assumes that -appdir and -profile are optional.) - Renames the loop variable `idx` as `i`. - Changes `!strcmp(...)` to `strcmp(...) == 0`, because I find that clearer. - Avoids a redundant nsCString when handling -appdir. The patch also tweaks GeckoChildProcessHost::mGroupId, which was buggy. It holds the appModelUserId argument, which XRE_InitChildProcess() always expects is present in the command. But it's only set to a non-empty value in InitWindowsGroupID(), which is only called for plugin processes. So in lots of cases the appModelUserId argument was missing, and a different argument would be interpreted as the appModelUserId argument (seemingly without noticeable ill effect). The patch changes things to mGroupId defaults to "-", which means it's always present in the command. Note: all this explains why the old code for ContentProcess::Init() started processing from argument aArgc, instead of aArgc-1 as you might expect -- it had to read one extra arg in order to see the argument following -appdir, because XRE_InitChildProcess() was decrementing aArgc for the appModelUserId argument even when that argument wasn't present. The new code for ContentProcess::Init() doesn't have to read past aArgc-1 because the mGroupId fix ensures the appModelUserId argument is always present. MozReview-Commit-ID: 8a8k6ABYMgo --HG-- extra : rebase_source : 70695125ee26e67af3337119f4dfc293a0dab74c |
||
---|---|---|
.. | ||
app | ||
chromium | ||
contentproc | ||
glue | ||
ipdl | ||
mscom | ||
testshell | ||
moz.build | ||
pull-chromium.py |