
There are the following two functions in net/base/mime_util.h which are used to deduce mime types from file extensions: - GetMimeTypeFromExtension - GetWellKnownMimeTypeFromExtension A common usage for these functions is to deduce the mime type of a given file path. There's the GetMimeTypeFromFile convenience function that extracts the file extension from the given path and calls GetMimeTypeFromExtension, but there's no similar function for GetWellKnownMimeTypeFromExtension. The change adds such a function, and simplifies some relevant code by using it. Bug: 400647848 Change-Id: I55c2c44f9baae978a62d867935fb7c328ce77738 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6316832 Reviewed-by: David Black <dmblack@google.com> Reviewed-by: Tsuyoshi Horo <horo@chromium.org> Reviewed-by: Mitsuru Oshima <oshima@chromium.org> Reviewed-by: Richard (Torne) Coles <torne@chromium.org> Commit-Queue: Michael Maltsev (R&D) <michaelm@island.io> Reviewed-by: Finnur Thorarinsson <finnur@chromium.org> Reviewed-by: Nasko Oskov <nasko@chromium.org> Reviewed-by: Simeon Anfinrud <sanfin@chromium.org> Reviewed-by: Kyle Horimoto <khorimoto@chromium.org> Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1433940}
This will become a reusable extensions module. It implements the core parts of Chrome's extension system, and can be used with any host of the content module.
Some extensions code that is not Chrome-specific still lives in //chrome/browser/extensions and will be moved here.
Technical Documentation: