Bug 1759163 - Add origin trial support for worklets. r=asuth

Move the trial getter to nsIGlobalObject, make every implementation
provide a reasonable value, and add a test.

Differential Revision: https://phabricator.services.mozilla.com/D140848
This commit is contained in:
Emilio Cobos Álvarez
2022-03-15 23:16:14 +00:00
parent 9c7ffc446d
commit c7c5de6781
25 changed files with 163 additions and 100 deletions

View File

@@ -1698,6 +1698,11 @@ uint32_t nsGlobalWindowOuter::GetPrincipalHashValue() const {
return 0;
}
OriginTrials nsGlobalWindowOuter::Trials() const {
return mInnerWindow ? nsGlobalWindowInner::Cast(mInnerWindow)->Trials()
: OriginTrials();
}
nsresult nsGlobalWindowOuter::EnsureScriptEnvironment() {
if (GetWrapperPreserveColor()) {
return NS_OK;