In GetFile(), GetDirectory() and Remove(), we must resolve the child
path by calling to ContentUriGetChildDocumentOrQuery(). If the path
already exists, we can use it as the backing path of the handle.
If the path does not exist, it is not possible to create the document
until all access checks have been done. So to handle this, a
query URI is created which encodes the relevant information. This URI
will eventually be used by NativeFileUtil::EnsureFileExists() or
CreateDirectory() to call ContentUriGetDocumentFromQuery() to
create the document.
In DidGetFile() and DidGetDirectory() we check via
ContentUriIsCreateChildDocumentQuery() to detect if a query URI is
being used and we update the handle with the valid URI of the
newly created document.
Bug: 376097631
Change-Id: I5e4b22f6668e49bd1ddb760a044fb17fd0f02a7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5981535
Reviewed-by: Nathan Memmott <memmott@chromium.org>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1379263}