web-ui: Introduce ChromeUntrustedWebUIControllerFactory
Currently WebUI properties, e.g. CSPs, requesting schemes, host, mojo, etc. are stored in WebUIControllers themselves. The lifetime of a WebUIController is bound to the frame, which makes it hard to use for some use cases. A non-dynamically allocated class where clients could query a WebUIs properties would be easier to use and audit. Introduces a new WebUIConfig class that stores properties of WebUIs. For now the two properties are 1. the WebUI's host and 2. if the WebUI is enabled. In the future this class could include information like CSPs, if we should enable Mojo, if we should enable chrome.send(), if we should allow network requests, URLDataSource, etc. For now all WebUIConfigs are owned by ChromeUntrustedWebUIControllerFactory but that could be moved somewhere else so that anyone could retrieve a WebUIConfig and check its properties. ChromeUntrustedWebUIControllerFactory holds a map of hosts to WebUIConfigs and implements WebUIControllerFactory methods by querying the appropriate config for its properties. Bug: 1080384 Change-Id: Ieebb0ded877f57d00d6f47aa5b9304cd250b1bf1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315572 Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org> Reviewed-by:dpapad <dpapad@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Reviewed-by:
Jiewei Qian <qjw@chromium.org> Reviewed-by:
calamity <calamity@chromium.org> Cr-Commit-Position: refs/heads/master@{#836974}
Showing
ui/webui/webui_config.cc
0 → 100644
ui/webui/webui_config.h
0 → 100644
Please register or sign in to comment