-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refine crossOriginIsolated implementation for workers
- Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for workers. - For SharedWorkers and ServiceWorkers it always return false. See https://crbug.com/1131403 and https://crbug.com/1131404. - Rename ExecutionContext::IsCrossOriginIsolated to CrossOriginCapability. This is aligned with https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability. - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html. I originally planned to do that in #24600 but I couldn't do that due to some flakiness. - Add more tests for workers in wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html. Bug: 1115379, 1018680, 1131403, 1131404 Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
- Loading branch information
1 parent
dbde516
commit 56ac316
Showing
3 changed files
with
154 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
html/cross-origin-embedder-policy/resources/cross-origin-isolated-worker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// For DedicatedWorker and ServiceWorker | ||
self.addEventListener('message', (e) => { | ||
e.data.port.postMessage(self.crossOriginIsolated); | ||
}); | ||
|
||
// For SharedWorker | ||
self.addEventListener('connect', (e) => { | ||
e.ports[0].onmessage = (ev) => { | ||
ev.data.port.postMessage(self.crossOriginIsolated); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters