[Fuchsia] Move allocation of PA_HND identifiers into LaunchOptions.
Mojo's PlatformChannel implemented its own mechanism to allocate PA_HND identifiers, and used the PA_USER0 namespace. Separately we had some callers expecting to use statically-defined PA_USER0 identifiers to pass application-specific handles, creating potential for clashes. For features like base::FieldTrialList we also need a mechanism to pass a handle to a child process at startup, for which we'd ideally have a well-known path location in the FDIO namespace supplied to the child. Since FDIO namespaces do not yet support non-file/directory handles, we need a safe way to allocate an id that the FieldTrial implementation can pass via the command-line, similarly to Mojo. We add an AddHandleToTransfer() helper that appends a handle to a handles-to-transfer vector with a unique id, and returns the id, and add comments to clarify that PA_USER1 is used for these ids, leaving PA_USER0 (and others) free for application use. Bug: 909851 Change-Id: If9b8ffaf98155f72cc7a52e5ef0c51ef19048d66 Reviewed-on: https://chromium-review.googlesource.com/c/1354398Reviewed-by:Kevin Marshall <kmarshall@chromium.org> Reviewed-by:
Sergey Ulanov <sergeyu@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Commit-Queue: Wez <wez@chromium.org> Cr-Commit-Position: refs/heads/master@{#612899}
Showing
Please register or sign in to comment