Allow origin trials to be enabled in worklets
As first seen in bug 799092, the AudioWorklet trial uncovered problems where [OriginTrialEnabled] interfaces were not being exposed for module scripts in worklets. The root cause is that WorkletGlobalScopes are defined to have a unique, opaque origin. This defeats the trial token validation which requires both a secure context, and that the origin for the context matches the origin in the token. For the purposes of origin trials, we believe it is sufficient to consider the context of the document that created the worklet. If the document is secure, and has valid token(s), the origin trial should be enabled. Analogous to this thread: https://github.com/whatwg/fetch/pull/527#issuecomment-335677387 This CL changes so that any tokens from the document are passed along to the worklet, and the origin of the document is used to validate any tokens. This applies to all types of worklets, although the problem was initially found for AudioWorklet. As well the AudioWorkletProcessor interface has the [OriginTrialEnabled] attribute reinstated (was removed in a previous CL as a short-term workaround). Bug: 799960 Change-Id: I98cca05a7710e463a10dcd8c17f302f311f531b3 Reviewed-on: https://chromium-review.googlesource.com/862257 Commit-Queue: Jason Chase <chasej@chromium.org> Reviewed-by:Kentaro Hara <haraken@chromium.org> Reviewed-by:
Ian Clelland <iclelland@chromium.org> Cr-Commit-Position: refs/heads/master@{#533035}
Showing
Please register or sign in to comment