mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Merge remote-tracking branch 'upstream/master' into feat-cow-infra
This commit is contained in:
commit
863c90acd8
6 changed files with 16 additions and 20 deletions
|
@ -53,7 +53,7 @@ use net_traits::IpcSend;
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use script_traits::{WorkerGlobalScopeInit, WorkerScriptLoadOrigin};
|
use script_traits::{WorkerGlobalScopeInit, WorkerScriptLoadOrigin};
|
||||||
use servo_rand::random;
|
use servo_rand::random;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||||
use std::mem::replace;
|
use std::mem::replace;
|
||||||
use std::sync::atomic::AtomicBool;
|
use std::sync::atomic::AtomicBool;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
@ -310,7 +310,7 @@ impl DedicatedWorkerGlobalScope {
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://html.spec.whatwg.org/multipage/#run-a-worker
|
// https://html.spec.whatwg.org/multipage/#run-a-worker
|
||||||
pub fn run_worker_scope(
|
pub fn run_worker_scope(
|
||||||
init: WorkerGlobalScopeInit,
|
mut init: WorkerGlobalScopeInit,
|
||||||
worker_url: ServoUrl,
|
worker_url: ServoUrl,
|
||||||
from_devtools_receiver: IpcReceiver<DevtoolScriptControlMsg>,
|
from_devtools_receiver: IpcReceiver<DevtoolScriptControlMsg>,
|
||||||
worker: TrustedWorkerAddress,
|
worker: TrustedWorkerAddress,
|
||||||
|
@ -387,6 +387,17 @@ impl DedicatedWorkerGlobalScope {
|
||||||
devtools_mpsc_chan,
|
devtools_mpsc_chan,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Step 8 "Set up a worker environment settings object [...]"
|
||||||
|
//
|
||||||
|
// <https://html.spec.whatwg.org/multipage/#script-settings-for-workers>
|
||||||
|
//
|
||||||
|
// > The origin: Return a unique opaque origin if `worker global
|
||||||
|
// > scope`'s url's scheme is "data", and `inherited origin`
|
||||||
|
// > otherwise.
|
||||||
|
if worker_url.scheme() == "data" {
|
||||||
|
init.origin = ImmutableOrigin::new_opaque();
|
||||||
|
}
|
||||||
|
|
||||||
let global = DedicatedWorkerGlobalScope::new(
|
let global = DedicatedWorkerGlobalScope::new(
|
||||||
init,
|
init,
|
||||||
DOMString::from_string(worker_name),
|
DOMString::from_string(worker_name),
|
||||||
|
@ -453,7 +464,7 @@ impl DedicatedWorkerGlobalScope {
|
||||||
.mem_profiler_chan()
|
.mem_profiler_chan()
|
||||||
.run_with_memory_reporting(
|
.run_with_memory_reporting(
|
||||||
|| {
|
|| {
|
||||||
// Step 29, Run the responsible event loop specified
|
// Step 27, Run the responsible event loop specified
|
||||||
// by inside settings until it is destroyed.
|
// by inside settings until it is destroyed.
|
||||||
// The worker processing model remains on this step
|
// The worker processing model remains on this step
|
||||||
// until the event loop is destroyed,
|
// until the event loop is destroyed,
|
||||||
|
|
|
@ -280,7 +280,7 @@ impl ServiceWorkerGlobalScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://html.spec.whatwg.org/multipage/#run-a-worker
|
// https://w3c.github.io/ServiceWorker/#run-service-worker-algorithm
|
||||||
pub fn run_serviceworker_scope(
|
pub fn run_serviceworker_scope(
|
||||||
scope_things: ScopeThings,
|
scope_things: ScopeThings,
|
||||||
own_sender: Sender<ServiceWorkerScriptMsg>,
|
own_sender: Sender<ServiceWorkerScriptMsg>,
|
||||||
|
@ -382,7 +382,7 @@ impl ServiceWorkerGlobalScope {
|
||||||
.mem_profiler_chan()
|
.mem_profiler_chan()
|
||||||
.run_with_memory_reporting(
|
.run_with_memory_reporting(
|
||||||
|| {
|
|| {
|
||||||
// Step 29, Run the responsible event loop specified
|
// Step 18, Run the responsible event loop specified
|
||||||
// by inside settings until it is destroyed.
|
// by inside settings until it is destroyed.
|
||||||
// The worker processing model remains on this step
|
// The worker processing model remains on this step
|
||||||
// until the event loop is destroyed,
|
// until the event loop is destroyed,
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[dedicated-worker-in-data-url-context.window.html]
|
|
||||||
[Create a dedicated worker in a data url dedicated worker]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[data-url-worker.html]
|
|
||||||
[fetching "top.txt" without ACAO should be rejected.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
[Same Origin SharedWorker]
|
[Same Origin SharedWorker]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Data Url Worker]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Data Url SharedWorker]
|
[Data Url SharedWorker]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[dedicated-worker-in-data-url-context.window.html]
|
|
||||||
[Create a dedicated worker in a data url dedicated worker]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue