Worklet: Make "unsafe-eval" CSP directive available for worklets
"unsafe-eval" CSP directive is enabled in WorkerOrWorkletScriptController::Evaluate(). This function is called for classic script evaluation, not for module script evaluation that worklets depend on. This means the current implementation doesn't work for worklets. To enable the directive for worklets, this CL moves the part from Evaluate() to InitializeContextIfNeeded() that is supposed to be called for both classic and module script evaluation. This CL also fixes ExecutionContext handling in CodeGenerationCheckCallbackInMainThread(). This path is called not only from Document but also from PaintWorklet. This change is tested for workers by existing CSP tests, and will be tested for worklets by tests to be added by a following change: https://chromium-review.googlesource.com/c/chromium/src/+/771051 Bug: 773786 Change-Id: I29232a4297b2f4819f1fe28f3230fc7ea4f769f6 Reviewed-on: https://chromium-review.googlesource.com/799654Reviewed-by:Kentaro Hara <haraken@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#520806}
Showing
Please register or sign in to comment