-
chrome-untrusted://media-appTrent Apted authored
Piex is the "Preview Image EXtractor" and is used by the Files app on ChromeOS for creating thumbnails inside the "image loader" component extension. It uses the `wasm-eval` CSP directive, which is only currently enabled for apps and extensions (standardisation being discussed at github.com/WebAssembly/content-security-policy/pull/13 ). To make the WASM work, this CL enables `wasm-eval` for chrome-untrusted://* CSP directives, and adds that to chrome-untrusted://media-app's CSP. Two new JS files are added to chrome-untrusted://media-app: - piex_module.js is a thin wrapper around the existing piex_loader.js to do (effectively) RAW -> JPEG conversions of Blob data. - piex_module_loader.js adds logic for runtime-loading of the WebAssembly, piex_loader.js, and piex_module.js An end-to-end test using the handcrafted "raw.orf" file is added to ensure the WASM loads and successfully extracts preview data, and it is successfully loaded by the app. Note this CL adds support, but doesn't change file handlers to direct RAW files to chrome://media-app, which will be gated behind a flag. Design Doc: go/bl-raw Launch Bug: https://crbug.com/1126203 Bug: 1030935, b/154062029, b/167496867 Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome Change-Id: I0c1f1da8bc39c8e6223214b49d9ac09dc93bf420 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422100Reviewed-by:
dpapad <dpapad@chromium.org> Reviewed-by:
Daniel Cheng <dcheng@chromium.org> Reviewed-by:
Noel Gordon <noel@chromium.org> Reviewed-by:
Patti <patricialor@chromium.org> Commit-Queue: Noel Gordon <noel@chromium.org> Auto-Submit: Trent Apted <tapted@chromium.org> Cr-Commit-Position: refs/heads/master@{#818636}
8bb8a094