mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Update crossbeam-channel to 0.3
This commit is contained in:
parent
76195e0779
commit
9a7eeb349a
74 changed files with 303 additions and 521 deletions
118
Cargo.lock
generated
118
Cargo.lock
generated
|
@ -226,7 +226,7 @@ dependencies = [
|
|||
"bluetooth_traits 0.0.1",
|
||||
"device 0.0.1 (git+https://github.com/servo/devices)",
|
||||
"embedder_traits 0.0.1",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_config 0.0.1",
|
||||
"servo_rand 0.0.1",
|
||||
|
@ -238,7 +238,7 @@ name = "bluetooth_traits"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"embedder_traits 0.0.1",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -354,7 +354,7 @@ dependencies = [
|
|||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"offscreen_gl_context 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -374,7 +374,7 @@ dependencies = [
|
|||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
"malloc_size_of_derive 0.0.1",
|
||||
|
@ -532,12 +532,13 @@ dependencies = [
|
|||
name = "compositing"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"embedder_traits 0.0.1",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx_traits 0.0.1",
|
||||
"gleam 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.20.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"keyboard-types 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -545,7 +546,6 @@ dependencies = [
|
|||
"net_traits 0.0.1",
|
||||
"profile_traits 0.0.1",
|
||||
"script_traits 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"servo_geometry 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
|
@ -566,6 +566,7 @@ dependencies = [
|
|||
"canvas_traits 0.0.1",
|
||||
"clipboard 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"compositing 0.0.1",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"debugger 0.0.1",
|
||||
"devtools_traits 0.0.1",
|
||||
"embedder_traits 0.0.1",
|
||||
|
@ -574,7 +575,7 @@ dependencies = [
|
|||
"gfx 0.0.1",
|
||||
"gfx_traits 0.0.1",
|
||||
"http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"keyboard-types 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layout_traits 0.0.1",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -585,7 +586,6 @@ dependencies = [
|
|||
"profile_traits 0.0.1",
|
||||
"script_traits 0.0.1",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"servo_rand 0.0.1",
|
||||
"servo_remutex 0.0.1",
|
||||
|
@ -649,7 +649,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.2.5"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-epoch 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -803,8 +803,8 @@ dependencies = [
|
|||
name = "debugger"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_channel 0.0.1",
|
||||
"ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
@ -847,18 +847,18 @@ dependencies = [
|
|||
name = "devtools"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"devtools_traits 0.0.1",
|
||||
"headers-core 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"headers-ext 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.12.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper_serde 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_channel 0.0.1",
|
||||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
@ -868,7 +868,7 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
"malloc_size_of_derive 0.0.1",
|
||||
"msg 0.0.1",
|
||||
|
@ -957,13 +957,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "embedder_traits"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"keyboard-types 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"style_traits 0.0.1",
|
||||
"webrender_api 0.57.2 (git+https://github.com/servo/webrender)",
|
||||
|
@ -1234,7 +1234,7 @@ dependencies = [
|
|||
"freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx_traits 0.0.1",
|
||||
"harfbuzz-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1829,11 +1829,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ipc-channel"
|
||||
version = "0.11.1"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1934,13 +1934,14 @@ dependencies = [
|
|||
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"canvas_traits 0.0.1",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx 0.0.1",
|
||||
"gfx_traits 0.0.1",
|
||||
"html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
|
@ -1959,7 +1960,6 @@ dependencies = [
|
|||
"serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_arc 0.1.1",
|
||||
"servo_atoms 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"servo_geometry 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
|
@ -1979,6 +1979,7 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"embedder_traits 0.0.1",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1987,7 +1988,7 @@ dependencies = [
|
|||
"gfx_traits 0.0.1",
|
||||
"histogram 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layout 0.0.1",
|
||||
"layout_traits 0.0.1",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2009,7 +2010,6 @@ dependencies = [
|
|||
"servo_allocator 0.0.1",
|
||||
"servo_arc 0.1.1",
|
||||
"servo_atoms 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"servo_geometry 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
|
@ -2023,14 +2023,14 @@ dependencies = [
|
|||
name = "layout_traits"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx 0.0.1",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"metrics 0.0.1",
|
||||
"msg 0.0.1",
|
||||
"net_traits 0.0.1",
|
||||
"profile_traits 0.0.1",
|
||||
"script_traits 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"webrender_api 0.57.2 (git+https://github.com/servo/webrender)",
|
||||
]
|
||||
|
@ -2100,7 +2100,7 @@ dependencies = [
|
|||
"canvas_traits 0.0.1",
|
||||
"compositing 0.0.1",
|
||||
"constellation 0.0.1",
|
||||
"crossbeam-channel 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"debugger 0.0.1",
|
||||
"devtools 0.0.1",
|
||||
"devtools_traits 0.0.1",
|
||||
|
@ -2110,7 +2110,7 @@ dependencies = [
|
|||
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
|
||||
"gfx 0.0.1",
|
||||
"gleam 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layout_thread 0.0.1",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
|
@ -2121,7 +2121,6 @@ dependencies = [
|
|||
"script 0.0.1",
|
||||
"script_layout_interface 0.0.1",
|
||||
"script_traits 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"servo_geometry 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
|
@ -2230,6 +2229,7 @@ name = "malloc_size_of"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hashglobe 0.1.0",
|
||||
|
@ -2241,7 +2241,6 @@ dependencies = [
|
|||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_arc 0.1.1",
|
||||
"servo_channel 0.0.1",
|
||||
"smallbitvec 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2317,7 +2316,7 @@ name = "metrics"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"gfx_traits 0.0.1",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
"malloc_size_of_derive 0.0.1",
|
||||
|
@ -2334,7 +2333,7 @@ name = "metrics_tests"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"gfx_traits 0.0.1",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"layout 0.0.1",
|
||||
"metrics 0.0.1",
|
||||
"msg 0.0.1",
|
||||
|
@ -2513,6 +2512,7 @@ dependencies = [
|
|||
"brotli 2.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"devtools_traits 0.0.1",
|
||||
"embedder_traits 0.0.1",
|
||||
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2524,7 +2524,7 @@ dependencies = [
|
|||
"hyper-openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper_serde 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"immeta 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
|
@ -2541,7 +2541,6 @@ dependencies = [
|
|||
"serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_allocator 0.0.1",
|
||||
"servo_arc 0.1.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"std_test_override 0.0.1",
|
||||
|
@ -2578,7 +2577,7 @@ dependencies = [
|
|||
"hyper 0.12.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper_serde 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.20.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
|
@ -2940,7 +2939,7 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"heartbeats-simple 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"influent 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"profile_traits 0.0.1",
|
||||
|
@ -2958,7 +2957,7 @@ dependencies = [
|
|||
name = "profile_tests"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"profile 0.0.1",
|
||||
"profile_traits 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
|
@ -2969,12 +2968,12 @@ name = "profile_traits"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"energy-monitor 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"energymon 0.3.0 (git+https://github.com/energymon/energymon-rust.git)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"signpost 0.1.0 (git+https://github.com/pcwalton/signpost.git)",
|
||||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3205,6 +3204,7 @@ dependencies = [
|
|||
"chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"deny_public_fields 0.0.1",
|
||||
"devtools_traits 0.0.1",
|
||||
|
@ -3223,7 +3223,7 @@ dependencies = [
|
|||
"hyper 0.12.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper_serde 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.20.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jstraceable_derive 0.0.1",
|
||||
"keyboard-types 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3262,7 +3262,6 @@ dependencies = [
|
|||
"servo_allocator 0.0.1",
|
||||
"servo_arc 0.1.1",
|
||||
"servo_atoms 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"servo_geometry 0.0.1",
|
||||
"servo_rand 0.0.1",
|
||||
|
@ -3289,11 +3288,12 @@ dependencies = [
|
|||
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"canvas_traits 0.0.1",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx_traits 0.0.1",
|
||||
"html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
|
@ -3307,7 +3307,6 @@ dependencies = [
|
|||
"selectors 0.20.0",
|
||||
"servo_arc 0.1.1",
|
||||
"servo_atoms 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"style 0.0.1",
|
||||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3342,6 +3341,7 @@ dependencies = [
|
|||
"bluetooth_traits 0.0.1",
|
||||
"canvas_traits 0.0.1",
|
||||
"cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"devtools_traits 0.0.1",
|
||||
"embedder_traits 0.0.1",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3349,7 +3349,7 @@ dependencies = [
|
|||
"http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.12.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper_serde 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"keyboard-types 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
|
@ -3359,7 +3359,6 @@ dependencies = [
|
|||
"profile_traits 0.0.1",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_atoms 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"style_traits 0.0.1",
|
||||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3429,7 +3428,7 @@ dependencies = [
|
|||
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3523,7 +3522,7 @@ dependencies = [
|
|||
"gstreamer-app 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-audio 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-player 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo-media-audio 0.1.0 (git+https://github.com/servo/media)",
|
||||
"servo-media-player 0.1.0 (git+https://github.com/servo/media)",
|
||||
|
@ -3535,7 +3534,7 @@ name = "servo-media-player"
|
|||
version = "0.1.0"
|
||||
source = "git+https://github.com/servo/media#3b347d7b0431c58611e2bd7b22d34062b64cda26"
|
||||
dependencies = [
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -3585,15 +3584,6 @@ dependencies = [
|
|||
"string_cache_codegen 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "servo_channel"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"crossbeam-channel 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "servo_config"
|
||||
version = "0.0.1"
|
||||
|
@ -3817,6 +3807,7 @@ dependencies = [
|
|||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"encoding_rs 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3846,7 +3837,6 @@ dependencies = [
|
|||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_arc 0.1.1",
|
||||
"servo_atoms 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"smallbitvec 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -4501,10 +4491,11 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.12.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.20.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"keyboard-types 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
|
@ -4513,7 +4504,6 @@ dependencies = [
|
|||
"script_traits 0.0.1",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -4569,7 +4559,7 @@ dependencies = [
|
|||
"core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dwrote 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -4581,13 +4571,13 @@ name = "webvr"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"canvas_traits 0.0.1",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"rust-webvr 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"script_traits 0.0.1",
|
||||
"servo_channel 0.0.1",
|
||||
"servo_config 0.0.1",
|
||||
"webvr_traits 0.0.1",
|
||||
]
|
||||
|
@ -4596,7 +4586,7 @@ dependencies = [
|
|||
name = "webvr_traits"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"rust-webvr-api 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -4851,7 +4841,7 @@ dependencies = [
|
|||
"checksum core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9"
|
||||
"checksum core-text 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6705907bc253cee90b8551017836ce50904be305c99fec5ea74a8d72d799e58"
|
||||
"checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
|
||||
"checksum crossbeam-channel 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a5716fadb87a5633db34c5e83ee6e036e6edc229f8a6bfb7c7c84ed340ba95df"
|
||||
"checksum crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "548dfc2fa4933009668d4a51f9ef074b8af8f2d6a6410225d76d6b1c3c56ca6f"
|
||||
"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3"
|
||||
"checksum crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3486aefc4c0487b9cb52372c97df0a48b8c249514af1ee99703bf70d2f2ceda1"
|
||||
"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150"
|
||||
|
@ -4953,7 +4943,7 @@ dependencies = [
|
|||
"checksum influent 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f06f65fa332019cbf57b927cd5a5da53cfce506109f38312fd597745a8a48c0"
|
||||
"checksum io-surface 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9a33981dff54baaff80f4decb487a65d148a3c00facc97820d0f09128f74dd"
|
||||
"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
|
||||
"checksum ipc-channel 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c593bd2e5ecae8bb15ce453b1ae16830830bd78e281f6380449c04cbd8165c30"
|
||||
"checksum ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a3a369bb751cf24f18084aabb56995268ec1f68d2b69937aaf031d41690c1bef"
|
||||
"checksum itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b07332223953b5051bceb67e8c4700aa65291535568e1f12408c43c4a42c0394"
|
||||
"checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682"
|
||||
"checksum jemalloc-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "479294d130502fada93c7a957e8d059b632b03d6204aca37af557dee947f30a9"
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
[package]
|
||||
name = "servo_channel"
|
||||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
name = "servo_channel"
|
||||
path = "lib.rs"
|
||||
test = false
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
crossbeam-channel = "0.2.5"
|
||||
ipc-channel = "0.11"
|
||||
serde = "1.0"
|
||||
|
||||
[[test]]
|
||||
name = "main"
|
||||
path = "tests/disconnect.rs"
|
|
@ -1,164 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
pub mod base_channel {
|
||||
pub use crossbeam_channel::*;
|
||||
}
|
||||
// Needed to re-export the select macro.
|
||||
pub use crossbeam_channel::*;
|
||||
|
||||
use ipc_channel::ipc::IpcReceiver;
|
||||
use ipc_channel::router::ROUTER;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub fn route_ipc_receiver_to_new_servo_receiver<T>(ipc_receiver: IpcReceiver<T>) -> Receiver<T>
|
||||
where
|
||||
T: for<'de> Deserialize<'de> + Serialize + Send + 'static,
|
||||
{
|
||||
let (servo_sender, servo_receiver) = channel();
|
||||
ROUTER.add_route(
|
||||
ipc_receiver.to_opaque(),
|
||||
Box::new(move |message| drop(servo_sender.send(message.to::<T>().unwrap()))),
|
||||
);
|
||||
servo_receiver
|
||||
}
|
||||
|
||||
pub fn route_ipc_receiver_to_new_servo_sender<T>(
|
||||
ipc_receiver: IpcReceiver<T>,
|
||||
servo_sender: Sender<T>,
|
||||
) where
|
||||
T: for<'de> Deserialize<'de> + Serialize + Send + 'static,
|
||||
{
|
||||
ROUTER.add_route(
|
||||
ipc_receiver.to_opaque(),
|
||||
Box::new(move |message| drop(servo_sender.send(message.to::<T>().unwrap()))),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
|
||||
let (base_sender, base_receiver) = crossbeam_channel::unbounded::<T>();
|
||||
let is_disconnected = Arc::new(AtomicBool::new(false));
|
||||
(
|
||||
Sender::new(base_sender, is_disconnected.clone()),
|
||||
Receiver::new(base_receiver, is_disconnected),
|
||||
)
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum ChannelError {
|
||||
ChannelClosedError,
|
||||
}
|
||||
|
||||
pub struct Receiver<T> {
|
||||
receiver: crossbeam_channel::Receiver<T>,
|
||||
is_disconnected: Arc<AtomicBool>,
|
||||
}
|
||||
|
||||
impl<T> Drop for Receiver<T> {
|
||||
fn drop(&mut self) {
|
||||
self.is_disconnected.store(true, Ordering::SeqCst);
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Clone for Receiver<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Receiver {
|
||||
receiver: self.receiver.clone(),
|
||||
is_disconnected: self.is_disconnected.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Receiver<T> {
|
||||
pub fn new(
|
||||
receiver: crossbeam_channel::Receiver<T>,
|
||||
is_disconnected: Arc<AtomicBool>,
|
||||
) -> Receiver<T> {
|
||||
Receiver {
|
||||
receiver,
|
||||
is_disconnected,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn recv(&self) -> Option<T> {
|
||||
self.receiver.recv()
|
||||
}
|
||||
|
||||
pub fn try_recv(&self) -> Option<T> {
|
||||
self.receiver.try_recv()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.receiver.len()
|
||||
}
|
||||
|
||||
pub fn select(&self) -> &crossbeam_channel::Receiver<T> {
|
||||
&self.receiver
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Iterator for Receiver<T> {
|
||||
type Item = T;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.receiver.recv()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> IntoIterator for &'a Receiver<T> {
|
||||
type Item = T;
|
||||
type IntoIter = crossbeam_channel::Receiver<T>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.receiver.clone()
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Sender<T> {
|
||||
sender: crossbeam_channel::Sender<T>,
|
||||
is_disconnected: Arc<AtomicBool>,
|
||||
}
|
||||
|
||||
impl<T> Clone for Sender<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Sender {
|
||||
sender: self.sender.clone(),
|
||||
is_disconnected: self.is_disconnected.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Sender<T> {
|
||||
pub fn new(
|
||||
sender: crossbeam_channel::Sender<T>,
|
||||
is_disconnected: Arc<AtomicBool>,
|
||||
) -> Sender<T> {
|
||||
Sender {
|
||||
sender,
|
||||
is_disconnected,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn send(&self, msg: T) -> Result<(), ChannelError> {
|
||||
if self.is_disconnected.load(Ordering::SeqCst) {
|
||||
Err(ChannelError::ChannelClosedError)
|
||||
} else {
|
||||
Ok(self.sender.send(msg))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.sender.len()
|
||||
}
|
||||
|
||||
pub fn select(&self) -> Option<&crossbeam_channel::Sender<T>> {
|
||||
if self.is_disconnected.load(Ordering::SeqCst) {
|
||||
None
|
||||
} else {
|
||||
Some(&self.sender)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[macro_use]
|
||||
extern crate servo_channel;
|
||||
|
||||
use servo_channel::{channel, ChannelError};
|
||||
|
||||
#[test]
|
||||
fn send_after_receiver_dropped() {
|
||||
let (sender, receiver) = channel();
|
||||
drop(receiver);
|
||||
assert_eq!(sender.send(1), Err(ChannelError::ChannelClosedError));
|
||||
let sent = select! {
|
||||
send(sender.select(), 1) => true,
|
||||
default => false
|
||||
};
|
||||
assert_eq!(sent, false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn send_with_receiver_connected() {
|
||||
let (sender, _receiver) = channel();
|
||||
assert_eq!(sender.send(1), Ok(()));
|
||||
let sent = select! {
|
||||
send(sender.select(), 1) => true,
|
||||
default => false
|
||||
};
|
||||
assert_eq!(sent, true);
|
||||
}
|
|
@ -15,6 +15,7 @@ path = "lib.rs"
|
|||
default = []
|
||||
|
||||
[dependencies]
|
||||
crossbeam-channel = "0.3"
|
||||
embedder_traits = {path = "../embedder_traits"}
|
||||
euclid = "0.19"
|
||||
gfx_traits = {path = "../gfx_traits"}
|
||||
|
@ -28,7 +29,6 @@ msg = {path = "../msg"}
|
|||
net_traits = {path = "../net_traits"}
|
||||
profile_traits = {path = "../profile_traits"}
|
||||
script_traits = {path = "../script_traits"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_config = {path = "../config"}
|
||||
servo_geometry = {path = "../geometry"}
|
||||
servo_url = {path = "../url"}
|
||||
|
|
|
@ -12,6 +12,7 @@ use crate::windowing::{
|
|||
};
|
||||
use crate::CompositionPipeline;
|
||||
use crate::SendableFrameTree;
|
||||
use crossbeam_channel::Sender;
|
||||
use euclid::{TypedPoint2D, TypedScale, TypedVector2D};
|
||||
use gfx_traits::Epoch;
|
||||
#[cfg(feature = "gleam")]
|
||||
|
@ -27,7 +28,6 @@ use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent, TouchEven
|
|||
use script_traits::{AnimationState, AnimationTickType, ConstellationMsg, LayoutControlMsg};
|
||||
use script_traits::{MouseButton, MouseEventType, ScrollState, TouchEventType, TouchId};
|
||||
use script_traits::{UntrustedNodeAddress, WindowSizeData, WindowSizeType};
|
||||
use servo_channel::Sender;
|
||||
use servo_config::opts;
|
||||
use servo_geometry::DeviceIndependentPixel;
|
||||
use std::collections::HashMap;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
use crate::compositor::CompositingReason;
|
||||
use crate::SendableFrameTree;
|
||||
use crossbeam_channel::{Receiver, Sender};
|
||||
use embedder_traits::EventLoopWaker;
|
||||
use gfx_traits::Epoch;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
|
@ -14,7 +15,6 @@ use net_traits::image::base::Image;
|
|||
use profile_traits::mem;
|
||||
use profile_traits::time;
|
||||
use script_traits::{AnimationState, ConstellationMsg, EventResult};
|
||||
use servo_channel::{Receiver, Sender};
|
||||
use std::fmt::{Debug, Error, Formatter};
|
||||
use style_traits::viewport::ViewportConstraints;
|
||||
use webrender_api::{self, DeviceIntPoint, DeviceUintSize};
|
||||
|
@ -50,7 +50,7 @@ pub struct CompositorReceiver {
|
|||
|
||||
impl CompositorReceiver {
|
||||
pub fn try_recv_compositor_msg(&mut self) -> Option<Msg> {
|
||||
self.receiver.try_recv()
|
||||
self.receiver.try_recv().ok()
|
||||
}
|
||||
pub fn recv_compositor_msg(&mut self) -> Msg {
|
||||
self.receiver.recv().unwrap()
|
||||
|
|
|
@ -17,6 +17,7 @@ canvas = {path = "../canvas"}
|
|||
clipboard = "0.5"
|
||||
canvas_traits = {path = "../canvas_traits"}
|
||||
compositing = {path = "../compositing"}
|
||||
crossbeam-channel = "0.3"
|
||||
debugger = {path = "../debugger"}
|
||||
devtools_traits = {path = "../devtools_traits"}
|
||||
euclid = "0.19"
|
||||
|
@ -35,7 +36,6 @@ net_traits = {path = "../net_traits"}
|
|||
profile_traits = {path = "../profile_traits"}
|
||||
script_traits = {path = "../script_traits"}
|
||||
serde = "1.0"
|
||||
servo_channel = {path = "../channel"}
|
||||
style_traits = {path = "../style_traits"}
|
||||
servo_config = {path = "../config"}
|
||||
servo_rand = {path = "../rand"}
|
||||
|
|
|
@ -110,6 +110,7 @@ use crate::session_history::{
|
|||
JointSessionHistory, NeedsToReload, SessionHistoryChange, SessionHistoryDiff,
|
||||
};
|
||||
use crate::timer_scheduler::TimerScheduler;
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
|
||||
use embedder_traits::{EmbedderMsg, EmbedderProxy};
|
||||
use euclid::{Size2D, TypedScale, TypedSize2D};
|
||||
|
@ -146,7 +147,6 @@ use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, Scri
|
|||
use script_traits::{SWManagerMsg, ScopeThings, UpdatePipelineIdReason, WebDriverCommandMsg};
|
||||
use script_traits::{WindowSizeData, WindowSizeType};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_channel::{channel, Receiver, Sender};
|
||||
use servo_config::opts;
|
||||
use servo_config::prefs::PREFS;
|
||||
use servo_rand::{random, Rng, SeedableRng, ServoRng};
|
||||
|
@ -555,7 +555,7 @@ fn route_ipc_receiver_to_new_mpsc_receiver_preserving_errors<T>(
|
|||
where
|
||||
T: for<'de> Deserialize<'de> + Serialize + Send + 'static,
|
||||
{
|
||||
let (mpsc_sender, mpsc_receiver) = channel();
|
||||
let (mpsc_sender, mpsc_receiver) = unbounded();
|
||||
ROUTER.add_route(
|
||||
ipc_receiver.to_opaque(),
|
||||
Box::new(move |message| drop(mpsc_sender.send(message.to::<T>()))),
|
||||
|
@ -572,7 +572,7 @@ where
|
|||
pub fn start(
|
||||
state: InitialConstellationState,
|
||||
) -> (Sender<FromCompositorMsg>, IpcSender<SWManagerMsg>) {
|
||||
let (compositor_sender, compositor_receiver) = channel();
|
||||
let (compositor_sender, compositor_receiver) = unbounded();
|
||||
|
||||
// service worker manager to communicate with constellation
|
||||
let (swmanager_sender, swmanager_receiver) = ipc::channel().expect("ipc channel failure");
|
||||
|
@ -591,7 +591,7 @@ where
|
|||
let layout_receiver =
|
||||
route_ipc_receiver_to_new_mpsc_receiver_preserving_errors(ipc_layout_receiver);
|
||||
|
||||
let (network_listener_sender, network_listener_receiver) = channel();
|
||||
let (network_listener_sender, network_listener_receiver) = unbounded();
|
||||
|
||||
let swmanager_receiver =
|
||||
route_ipc_receiver_to_new_mpsc_receiver_preserving_errors(swmanager_receiver);
|
||||
|
@ -906,21 +906,21 @@ where
|
|||
// being called. If this happens, there's not much we can do
|
||||
// other than panic.
|
||||
let request = select! {
|
||||
recv(self.script_receiver.select(), msg) => {
|
||||
recv(self.script_receiver) -> msg => {
|
||||
msg.expect("Unexpected script channel panic in constellation").map(Request::Script)
|
||||
}
|
||||
recv(self.compositor_receiver.select(), msg) => {
|
||||
recv(self.compositor_receiver) -> msg => {
|
||||
Ok(Request::Compositor(msg.expect("Unexpected compositor channel panic in constellation")))
|
||||
}
|
||||
recv(self.layout_receiver.select(), msg) => {
|
||||
recv(self.layout_receiver) -> msg => {
|
||||
msg.expect("Unexpected layout channel panic in constellation").map(Request::Layout)
|
||||
}
|
||||
recv(self.network_listener_receiver.select(), msg) => {
|
||||
recv(self.network_listener_receiver) -> msg => {
|
||||
Ok(Request::NetworkListener(
|
||||
msg.expect("Unexpected network listener channel panic in constellation")
|
||||
))
|
||||
}
|
||||
recv(self.swmanager_receiver.select(), msg) => {
|
||||
recv(self.swmanager_receiver) -> msg => {
|
||||
msg.expect("Unexpected panic channel panic in constellation").map(Request::FromSWManager)
|
||||
}
|
||||
};
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
#![deny(unsafe_code)]
|
||||
#![cfg_attr(feature = "unstable", feature(conservative_impl_trait))]
|
||||
|
||||
#[macro_use]
|
||||
extern crate crossbeam_channel;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[macro_use]
|
||||
extern crate servo_channel;
|
||||
extern crate serde;
|
||||
|
||||
mod browsingcontext;
|
||||
mod constellation;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
//! Any redirects that are encountered are followed. Whenever a non-redirect
|
||||
//! response is received, it is forwarded to the appropriate script thread.
|
||||
|
||||
use crossbeam_channel::Sender;
|
||||
use http::header::LOCATION;
|
||||
use ipc_channel::ipc;
|
||||
use ipc_channel::router::ROUTER;
|
||||
|
@ -15,7 +16,6 @@ use net_traits::request::{Destination, RequestInit};
|
|||
use net_traits::response::ResponseInit;
|
||||
use net_traits::{CoreResourceMsg, FetchChannels, FetchMetadata, FetchResponseMsg};
|
||||
use net_traits::{IpcSend, NetworkError, ResourceThreads};
|
||||
use servo_channel::Sender;
|
||||
|
||||
pub struct NetworkListener {
|
||||
res_init: Option<ResponseInit>,
|
||||
|
|
|
@ -8,6 +8,7 @@ use compositing::compositor_thread::Msg as CompositorMsg;
|
|||
use compositing::CompositionPipeline;
|
||||
use compositing::CompositorProxy;
|
||||
use crate::event_loop::EventLoop;
|
||||
use crossbeam_channel::Sender;
|
||||
use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg};
|
||||
use euclid::{TypedScale, TypedSize2D};
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
|
@ -28,7 +29,6 @@ use script_traits::{DocumentActivity, InitialScriptState};
|
|||
use script_traits::{LayoutControlMsg, LayoutMsg, LoadData};
|
||||
use script_traits::{NewLayoutInfo, SWManagerMsg, SWManagerSenders};
|
||||
use script_traits::{ScriptThreadFactory, TimerSchedulerMsg, WindowSizeData};
|
||||
use servo_channel::Sender;
|
||||
use servo_config::opts::{self, Opts};
|
||||
use servo_config::prefs::{Pref, PREFS};
|
||||
use servo_url::ServoUrl;
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crossbeam_channel::{self, TryRecvError};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use script_traits::{TimerEvent, TimerEventRequest, TimerSchedulerMsg};
|
||||
use servo_channel::base_channel;
|
||||
use std::cmp::{self, Ord};
|
||||
use std::collections::BinaryHeap;
|
||||
use std::thread;
|
||||
|
@ -39,7 +39,7 @@ impl PartialEq for ScheduledEvent {
|
|||
impl TimerScheduler {
|
||||
pub fn start() -> IpcSender<TimerSchedulerMsg> {
|
||||
let (req_ipc_sender, req_ipc_receiver) = ipc::channel().expect("Channel creation failed.");
|
||||
let (req_sender, req_receiver) = base_channel::bounded(1);
|
||||
let (req_sender, req_receiver) = crossbeam_channel::bounded(1);
|
||||
|
||||
// We could do this much more directly with recv_timeout
|
||||
// (https://github.com/rust-lang/rfcs/issues/962).
|
||||
|
@ -69,29 +69,26 @@ impl TimerScheduler {
|
|||
scheduled_events.pop();
|
||||
}
|
||||
// Look to see if there are any incoming events
|
||||
select! {
|
||||
recv(req_receiver, msg) => match msg {
|
||||
// If there is an event, add it to the priority queue
|
||||
Some(TimerSchedulerMsg::Request(req)) => {
|
||||
let TimerEventRequest(_, _, _, delay) = req;
|
||||
let schedule = Instant::now() + Duration::from_millis(delay.get());
|
||||
let event = ScheduledEvent {
|
||||
request: req,
|
||||
for_time: schedule,
|
||||
};
|
||||
scheduled_events.push(event);
|
||||
},
|
||||
// If the channel is closed or we are shutting down, we are done.
|
||||
Some(TimerSchedulerMsg::Exit) |
|
||||
None => break,
|
||||
match req_receiver.try_recv() {
|
||||
// If there is an event, add it to the priority queue
|
||||
Ok(TimerSchedulerMsg::Request(req)) => {
|
||||
let TimerEventRequest(_, _, _, delay) = req;
|
||||
let schedule = Instant::now() + Duration::from_millis(delay.get());
|
||||
let event = ScheduledEvent {
|
||||
request: req,
|
||||
for_time: schedule,
|
||||
};
|
||||
scheduled_events.push(event);
|
||||
},
|
||||
// If there is no incoming event, park the thread,
|
||||
// it will either be unparked when a new event arrives,
|
||||
// or by a timeout.
|
||||
default => match scheduled_events.peek() {
|
||||
Err(TryRecvError::Empty) => match scheduled_events.peek() {
|
||||
None => thread::park(),
|
||||
Some(event) => thread::park_timeout(event.for_time - now),
|
||||
},
|
||||
// If the channel is closed or we are shutting down, we are done.
|
||||
Ok(TimerSchedulerMsg::Exit) | Err(TryRecvError::Disconnected) => break,
|
||||
}
|
||||
}
|
||||
// This thread can terminate if the req_ipc_sender is dropped.
|
||||
|
|
|
@ -12,6 +12,6 @@ path = "lib.rs"
|
|||
crate_type = ["rlib"]
|
||||
|
||||
[dependencies]
|
||||
crossbeam-channel = "0.3"
|
||||
log = "0.4"
|
||||
servo_channel = {path = "../channel"}
|
||||
ws = "0.7.3"
|
||||
|
|
|
@ -12,7 +12,7 @@ enum Message {
|
|||
ShutdownServer,
|
||||
}
|
||||
|
||||
pub struct Sender(servo_channel::Sender<Message>);
|
||||
pub struct Sender(crossbeam_channel::Sender<Message>);
|
||||
|
||||
struct Connection {
|
||||
sender: ws::Sender,
|
||||
|
@ -35,7 +35,7 @@ impl Handler for Connection {
|
|||
|
||||
pub fn start_server(port: u16) -> Sender {
|
||||
debug!("Starting server.");
|
||||
let (sender, receiver) = servo_channel::channel();
|
||||
let (sender, receiver) = crossbeam_channel::unbounded();
|
||||
thread::Builder::new()
|
||||
.name("debugger".to_owned())
|
||||
.spawn(move || {
|
||||
|
@ -49,7 +49,7 @@ pub fn start_server(port: u16) -> Sender {
|
|||
socket.listen(("127.0.0.1", port)).unwrap();
|
||||
})
|
||||
.expect("Thread spawning failed");
|
||||
while let Some(message) = receiver.recv() {
|
||||
while let Ok(message) = receiver.recv() {
|
||||
match message {
|
||||
Message::ShutdownServer => {
|
||||
break;
|
||||
|
|
|
@ -11,6 +11,7 @@ name = "devtools"
|
|||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
crossbeam-channel = "0.3"
|
||||
devtools_traits = {path = "../devtools_traits"}
|
||||
headers-core = "0.0.1"
|
||||
headers-ext = "0.0.3"
|
||||
|
@ -22,5 +23,4 @@ log = "0.4"
|
|||
msg = {path = "../msg"}
|
||||
serde = "1.0"
|
||||
serde_json = "1.0"
|
||||
servo_channel = {path = "../channel"}
|
||||
time = "0.1"
|
||||
|
|
|
@ -33,12 +33,12 @@ use crate::actors::thread::ThreadActor;
|
|||
use crate::actors::timeline::TimelineActor;
|
||||
use crate::actors::worker::WorkerActor;
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use devtools_traits::{ChromeToDevtoolsControlMsg, ConsoleMessage, DevtoolsControlMsg};
|
||||
use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo, LogLevel, NetworkEvent};
|
||||
use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId};
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use servo_channel::{channel, Receiver, Sender};
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::hash_map::Entry::{Occupied, Vacant};
|
||||
|
@ -125,7 +125,7 @@ struct ResponseStartUpdateMsg {
|
|||
|
||||
/// Spin up a devtools server that listens for connections on the specified port.
|
||||
pub fn start_server(port: u16) -> Sender<DevtoolsControlMsg> {
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
{
|
||||
let sender = sender.clone();
|
||||
thread::Builder::new()
|
||||
|
@ -549,7 +549,7 @@ fn run_server(
|
|||
})
|
||||
.expect("Thread spawning failed");
|
||||
|
||||
while let Some(msg) = receiver.recv() {
|
||||
while let Ok(msg) = receiver.recv() {
|
||||
match msg {
|
||||
DevtoolsControlMsg::FromChrome(ChromeToDevtoolsControlMsg::AddClient(stream)) => {
|
||||
let actors = actors.clone();
|
||||
|
|
|
@ -11,13 +11,13 @@ name = "embedder_traits"
|
|||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
crossbeam-channel = "0.3"
|
||||
ipc-channel = "0.11"
|
||||
keyboard-types = "0.4.3"
|
||||
lazy_static = "1"
|
||||
log = "0.4"
|
||||
msg = {path = "../msg"}
|
||||
serde = "1.0"
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_url = {path = "../url"}
|
||||
style_traits = {path = "../style_traits", features = ["servo"]}
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
|
|
|
@ -11,10 +11,10 @@ extern crate serde;
|
|||
|
||||
pub mod resources;
|
||||
|
||||
use crossbeam_channel::{Receiver, Sender};
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use keyboard_types::KeyboardEvent;
|
||||
use msg::constellation_msg::{InputMethodType, TopLevelBrowsingContextId};
|
||||
use servo_channel::{Receiver, Sender};
|
||||
use servo_url::ServoUrl;
|
||||
use std::fmt::{Debug, Error, Formatter};
|
||||
use style_traits::cursor::CursorKind;
|
||||
|
@ -60,7 +60,7 @@ impl EmbedderReceiver {
|
|||
pub fn try_recv_embedder_msg(
|
||||
&mut self,
|
||||
) -> Option<(Option<TopLevelBrowsingContextId>, EmbedderMsg)> {
|
||||
self.receiver.try_recv()
|
||||
self.receiver.try_recv().ok()
|
||||
}
|
||||
pub fn recv_embedder_msg(&mut self) -> (Option<TopLevelBrowsingContextId>, EmbedderMsg) {
|
||||
self.receiver.recv().unwrap()
|
||||
|
|
|
@ -17,6 +17,7 @@ app_units = "0.7"
|
|||
atomic_refcell = "0.1"
|
||||
bitflags = "1.0"
|
||||
canvas_traits = {path = "../canvas_traits"}
|
||||
crossbeam-channel = "0.3"
|
||||
euclid = "0.19"
|
||||
fnv = "1.0"
|
||||
fxhash = "0.2"
|
||||
|
@ -41,7 +42,6 @@ selectors = { path = "../selectors" }
|
|||
serde = "1.0"
|
||||
servo_arc = {path = "../servo_arc"}
|
||||
servo_atoms = {path = "../atoms"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_geometry = {path = "../geometry"}
|
||||
serde_json = "1.0"
|
||||
servo_config = {path = "../config"}
|
||||
|
|
|
@ -8,12 +8,12 @@ use crate::context::LayoutContext;
|
|||
use crate::display_list::items::OpaqueNode;
|
||||
use crate::flow::{Flow, GetBaseFlow};
|
||||
use crate::opaque_node::OpaqueNodeMethods;
|
||||
use crossbeam_channel::Receiver;
|
||||
use fxhash::FxHashMap;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use script_traits::UntrustedNodeAddress;
|
||||
use script_traits::{AnimationState, ConstellationControlMsg, LayoutMsg as ConstellationMsg};
|
||||
use servo_channel::Receiver;
|
||||
use style::animation::{update_style_for_animation, Animation};
|
||||
use style::dom::TElement;
|
||||
use style::font_metrics::ServoMetricsProvider;
|
||||
|
@ -36,7 +36,7 @@ pub fn update_animation_state<E>(
|
|||
E: TElement,
|
||||
{
|
||||
let mut new_running_animations = vec![];
|
||||
while let Some(animation) = new_animations_receiver.try_recv() {
|
||||
while let Ok(animation) = new_animations_receiver.try_recv() {
|
||||
let mut should_push = true;
|
||||
if let Animation::Keyframes(ref node, _, ref name, ref state) = animation {
|
||||
// If the animation was already present in the list for the
|
||||
|
|
|
@ -16,6 +16,7 @@ unstable = ["parking_lot/nightly"]
|
|||
[dependencies]
|
||||
app_units = "0.7"
|
||||
atomic_refcell = "0.1"
|
||||
crossbeam-channel = "0.3"
|
||||
embedder_traits = {path = "../embedder_traits"}
|
||||
euclid = "0.19"
|
||||
fnv = "1.0"
|
||||
|
@ -47,7 +48,6 @@ serde_json = "1.0"
|
|||
servo_allocator = {path = "../allocator"}
|
||||
servo_arc = {path = "../servo_arc"}
|
||||
servo_atoms = {path = "../atoms"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_config = {path = "../config"}
|
||||
servo_geometry = {path = "../geometry"}
|
||||
servo_url = {path = "../url"}
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
//! The layout thread. Performs layout on the DOM, builds display lists and sends them to be
|
||||
//! painted.
|
||||
|
||||
#[macro_use]
|
||||
extern crate crossbeam_channel;
|
||||
#[macro_use]
|
||||
extern crate html5ever;
|
||||
#[macro_use]
|
||||
|
@ -15,14 +17,13 @@ extern crate lazy_static;
|
|||
extern crate log;
|
||||
#[macro_use]
|
||||
extern crate profile_traits;
|
||||
#[macro_use]
|
||||
extern crate servo_channel;
|
||||
|
||||
mod dom_wrapper;
|
||||
|
||||
use app_units::Au;
|
||||
use crate::dom_wrapper::drop_style_and_layout_data;
|
||||
use crate::dom_wrapper::{ServoLayoutDocument, ServoLayoutElement, ServoLayoutNode};
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use embedder_traits::resources::{self, Resource};
|
||||
use euclid::{Point2D, Rect, Size2D, TypedScale, TypedSize2D};
|
||||
use fnv::FnvHashMap;
|
||||
|
@ -33,6 +34,7 @@ use gfx::font_context;
|
|||
use gfx_traits::{node_id_from_scroll_id, Epoch};
|
||||
use histogram::Histogram;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use layout::animation;
|
||||
use layout::construct::ConstructionResult;
|
||||
use layout::context::malloc_size_of_persistent_local_context;
|
||||
|
@ -82,7 +84,6 @@ use script_traits::{ScrollState, UntrustedNodeAddress};
|
|||
use selectors::Element;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::{channel, route_ipc_receiver_to_new_servo_receiver, Receiver, Sender};
|
||||
use servo_config::opts;
|
||||
use servo_config::prefs::PREFS;
|
||||
use servo_geometry::MaxRect;
|
||||
|
@ -474,14 +475,15 @@ impl LayoutThread {
|
|||
debug!("Possible layout Threads: {}", layout_threads);
|
||||
|
||||
// Create the channel on which new animations can be sent.
|
||||
let (new_animations_sender, new_animations_receiver) = channel();
|
||||
let (new_animations_sender, new_animations_receiver) = unbounded();
|
||||
|
||||
// Proxy IPC messages from the pipeline to the layout thread.
|
||||
let pipeline_receiver = route_ipc_receiver_to_new_servo_receiver(pipeline_port);
|
||||
let pipeline_receiver = ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(pipeline_port);
|
||||
|
||||
// Ask the router to proxy IPC messages from the font cache thread to the layout thread.
|
||||
let (ipc_font_cache_sender, ipc_font_cache_receiver) = ipc::channel().unwrap();
|
||||
let font_cache_receiver = route_ipc_receiver_to_new_servo_receiver(ipc_font_cache_receiver);
|
||||
let font_cache_receiver =
|
||||
ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(ipc_font_cache_receiver);
|
||||
|
||||
LayoutThread {
|
||||
id: id,
|
||||
|
@ -612,9 +614,9 @@ impl LayoutThread {
|
|||
}
|
||||
|
||||
let request = select! {
|
||||
recv(self.pipeline_port.select(), msg) => Request::FromPipeline(msg.unwrap()),
|
||||
recv(self.port.select(), msg) => Request::FromScript(msg.unwrap()),
|
||||
recv(self.font_cache_receiver.select(), msg) => { msg.unwrap(); Request::FromFontCache }
|
||||
recv(self.pipeline_port) -> msg => Request::FromPipeline(msg.unwrap()),
|
||||
recv(self.port) -> msg => Request::FromScript(msg.unwrap()),
|
||||
recv(self.font_cache_receiver) -> msg => { msg.unwrap(); Request::FromFontCache }
|
||||
};
|
||||
|
||||
match request {
|
||||
|
|
|
@ -11,6 +11,7 @@ name = "layout_traits"
|
|||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
crossbeam-channel = "0.3"
|
||||
gfx = {path = "../gfx"}
|
||||
ipc-channel = "0.11"
|
||||
metrics = {path = "../metrics"}
|
||||
|
@ -18,6 +19,5 @@ msg = {path = "../msg"}
|
|||
net_traits = {path = "../net_traits"}
|
||||
profile_traits = {path = "../profile_traits"}
|
||||
script_traits = {path = "../script_traits"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_url = {path = "../url"}
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
// The traits are here instead of in layout so
|
||||
// that these modules won't have to depend on layout.
|
||||
|
||||
use crossbeam_channel::{Receiver, Sender};
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
||||
use metrics::PaintTimeMetrics;
|
||||
|
@ -18,7 +19,6 @@ use net_traits::image_cache::ImageCache;
|
|||
use profile_traits::{mem, time};
|
||||
use script_traits::LayoutMsg as ConstellationMsg;
|
||||
use script_traits::{ConstellationControlMsg, LayoutControlMsg};
|
||||
use servo_channel::{Receiver, Sender};
|
||||
use servo_url::ServoUrl;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ path = "lib.rs"
|
|||
|
||||
[features]
|
||||
servo = [
|
||||
"crossbeam-channel",
|
||||
"hyper",
|
||||
"hyper_serde",
|
||||
"keyboard-types",
|
||||
"mozjs",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"servo_channel",
|
||||
"string_cache",
|
||||
"time",
|
||||
"url",
|
||||
|
@ -26,6 +26,7 @@ servo = [
|
|||
|
||||
[dependencies]
|
||||
app_units = "0.7"
|
||||
crossbeam-channel = { version = "0.3", optional = true }
|
||||
cssparser = "0.25"
|
||||
euclid = "0.19"
|
||||
hashglobe = { path = "../hashglobe" }
|
||||
|
@ -37,7 +38,6 @@ selectors = { path = "../selectors" }
|
|||
serde = { version = "1.0.27", optional = true }
|
||||
serde_bytes = { version = "0.10", optional = true }
|
||||
servo_arc = { path = "../servo_arc" }
|
||||
servo_channel = { path = "../channel", optional = true }
|
||||
smallbitvec = "2.1.0"
|
||||
smallvec = "0.6"
|
||||
string_cache = { version = "0.7", optional = true }
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
//! `<Box<_> as MallocSizeOf>::size_of(field, ops)`.
|
||||
|
||||
extern crate app_units;
|
||||
#[cfg(feature = "servo")]
|
||||
extern crate crossbeam_channel;
|
||||
extern crate cssparser;
|
||||
extern crate euclid;
|
||||
extern crate hashglobe;
|
||||
|
@ -61,8 +63,6 @@ extern crate serde;
|
|||
#[cfg(feature = "servo")]
|
||||
extern crate serde_bytes;
|
||||
extern crate servo_arc;
|
||||
#[cfg(feature = "servo")]
|
||||
extern crate servo_channel;
|
||||
extern crate smallbitvec;
|
||||
extern crate smallvec;
|
||||
#[cfg(feature = "servo")]
|
||||
|
@ -1027,7 +1027,7 @@ where
|
|||
// Placeholder for unique case where internals of Sender cannot be measured.
|
||||
// malloc size of is 0 macro complains about type supplied!
|
||||
#[cfg(feature = "servo")]
|
||||
impl<T> MallocSizeOf for servo_channel::Sender<T> {
|
||||
impl<T> MallocSizeOf for crossbeam_channel::Sender<T> {
|
||||
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
|
||||
0
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ base64 = "0.9"
|
|||
brotli = "2.5"
|
||||
bytes = "0.4"
|
||||
cookie_rs = {package = "cookie", version = "0.11"}
|
||||
crossbeam-channel = "0.3"
|
||||
devtools_traits = {path = "../devtools_traits"}
|
||||
embedder_traits = { path = "../embedder_traits" }
|
||||
flate2 = "1"
|
||||
|
@ -47,7 +48,6 @@ serde = "1.0"
|
|||
serde_json = "1.0"
|
||||
servo_allocator = {path = "../allocator"}
|
||||
servo_arc = {path = "../servo_arc"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_config = {path = "../config"}
|
||||
servo_url = {path = "../url"}
|
||||
tokio = "0.1"
|
||||
|
|
|
@ -9,6 +9,7 @@ use crate::filemanager_thread::FileManager;
|
|||
use crate::http_loader::{determine_request_referrer, http_fetch, HttpState};
|
||||
use crate::http_loader::{set_default_accept, set_default_accept_language};
|
||||
use crate::subresource_integrity::is_response_integrity_valid;
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use devtools_traits::DevtoolsControlMsg;
|
||||
use headers_core::HeaderMapExt;
|
||||
use headers_ext::{AccessControlExposeHeaders, ContentType, Range};
|
||||
|
@ -22,7 +23,6 @@ use net_traits::request::{CredentialsMode, Destination, Referrer, Request, Reque
|
|||
use net_traits::request::{Origin, ResponseTainting, Window};
|
||||
use net_traits::response::{Response, ResponseBody, ResponseType};
|
||||
use net_traits::{FetchTaskTarget, NetworkError, ReferrerPolicy};
|
||||
use servo_channel::{channel, Receiver, Sender};
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::Cow;
|
||||
use std::fs::File;
|
||||
|
@ -540,7 +540,7 @@ fn scheme_fetch(
|
|||
let mut response = Response::new(url);
|
||||
response.headers.typed_insert(ContentType::from(mime));
|
||||
|
||||
let (done_sender, done_receiver) = channel();
|
||||
let (done_sender, done_receiver) = unbounded();
|
||||
*done_chan = Some((done_sender.clone(), done_receiver));
|
||||
*response.body.lock().unwrap() = ResponseBody::Receiving(vec![]);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
//! and <http://tools.ietf.org/html/rfc7232>.
|
||||
|
||||
use crate::fetch::methods::{Data, DoneChannel};
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use headers_core::HeaderMapExt;
|
||||
use headers_ext::{CacheControl, ContentRange, Expires, LastModified, Pragma, Range, Vary};
|
||||
use http::header::HeaderValue;
|
||||
|
@ -21,7 +22,6 @@ use net_traits::request::Request;
|
|||
use net_traits::response::{HttpsState, Response, ResponseBody};
|
||||
use net_traits::{FetchMetadata, Metadata};
|
||||
use servo_arc::Arc;
|
||||
use servo_channel::{channel, Sender};
|
||||
use servo_config::prefs::PREFS;
|
||||
use servo_url::ServoUrl;
|
||||
use std::collections::HashMap;
|
||||
|
@ -306,7 +306,7 @@ fn create_cached_response(
|
|||
response.headers = cached_headers.clone();
|
||||
response.body = cached_resource.body.clone();
|
||||
if let ResponseBody::Receiving(_) = *cached_resource.body.lock().unwrap() {
|
||||
let (done_sender, done_receiver) = channel();
|
||||
let (done_sender, done_receiver) = unbounded();
|
||||
*done_chan = Some((done_sender.clone(), done_receiver));
|
||||
cached_resource
|
||||
.awaiting_body
|
||||
|
@ -670,7 +670,7 @@ impl HttpCache {
|
|||
// Otherwise, create a new dedicated channel to update the consumer.
|
||||
// The response constructed here will replace the 304 one from the network.
|
||||
let in_progress_channel = match *cached_resource.body.lock().unwrap() {
|
||||
ResponseBody::Receiving(..) => Some(channel()),
|
||||
ResponseBody::Receiving(..) => Some(unbounded()),
|
||||
ResponseBody::Empty | ResponseBody::Done(..) => None,
|
||||
};
|
||||
match in_progress_channel {
|
||||
|
|
|
@ -15,6 +15,7 @@ use crate::fetch::methods::{Data, DoneChannel, FetchContext, Target};
|
|||
use crate::hsts::HstsList;
|
||||
use crate::http_cache::HttpCache;
|
||||
use crate::resource_thread::AuthCache;
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use devtools_traits::{
|
||||
ChromeToDevtoolsControlMsg, DevtoolsControlMsg, HttpRequest as DevtoolsHttpRequest,
|
||||
};
|
||||
|
@ -44,7 +45,6 @@ use net_traits::request::{ResponseTainting, ServiceWorkersMode};
|
|||
use net_traits::response::{HttpsState, Response, ResponseBody, ResponseType};
|
||||
use net_traits::{CookieSource, FetchMetadata, NetworkError, ReferrerPolicy};
|
||||
use openssl::ssl::SslConnectorBuilder;
|
||||
use servo_channel::{channel, Sender};
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::error::Error;
|
||||
|
@ -1215,7 +1215,7 @@ fn http_network_fetch(
|
|||
let res_body = response.body.clone();
|
||||
|
||||
// We're about to spawn a future to be waited on here
|
||||
let (done_sender, done_receiver) = channel();
|
||||
let (done_sender, done_receiver) = unbounded();
|
||||
*done_chan = Some((done_sender.clone(), done_receiver));
|
||||
let meta = match response
|
||||
.metadata()
|
||||
|
|
|
@ -15,6 +15,7 @@ use crate::http_cache::HttpCache;
|
|||
use crate::http_loader::{http_redirect_fetch, HttpState, HANDLE};
|
||||
use crate::storage_thread::StorageThreadFactory;
|
||||
use crate::websocket_loader;
|
||||
use crossbeam_channel::Sender;
|
||||
use devtools_traits::DevtoolsControlMsg;
|
||||
use embedder_traits::resources::{self, Resource};
|
||||
use embedder_traits::EmbedderProxy;
|
||||
|
@ -32,7 +33,6 @@ use profile_traits::mem::ProfilerChan as MemProfilerChan;
|
|||
use profile_traits::mem::{Report, ReportKind, ReportsChan};
|
||||
use profile_traits::time::ProfilerChan;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_channel::Sender;
|
||||
use servo_config::opts;
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::{Cow, ToOwned};
|
||||
|
|
|
@ -9,6 +9,7 @@ use crate::{
|
|||
create_embedder_proxy, fetch, make_server, make_ssl_server, new_fetch_context,
|
||||
DEFAULT_USER_AGENT,
|
||||
};
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use devtools_traits::HttpRequest as DevtoolsHttpRequest;
|
||||
use devtools_traits::HttpResponse as DevtoolsHttpResponse;
|
||||
use headers_core::HeaderMapExt;
|
||||
|
@ -37,7 +38,6 @@ use net_traits::response::{CacheState, Response, ResponseBody, ResponseType};
|
|||
use net_traits::IncludeSubdomains;
|
||||
use net_traits::NetworkError;
|
||||
use net_traits::ReferrerPolicy;
|
||||
use servo_channel::{channel, Sender};
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
@ -891,7 +891,7 @@ fn test_fetch_redirect_updates_method_runner(
|
|||
|
||||
#[test]
|
||||
fn test_fetch_redirect_updates_method() {
|
||||
let (tx, rx) = channel();
|
||||
let (tx, rx) = unbounded();
|
||||
|
||||
test_fetch_redirect_updates_method_runner(
|
||||
tx.clone(),
|
||||
|
@ -901,17 +901,17 @@ fn test_fetch_redirect_updates_method() {
|
|||
assert_eq!(rx.recv().unwrap(), true);
|
||||
assert_eq!(rx.recv().unwrap(), true);
|
||||
// make sure the test doesn't send more data than expected
|
||||
assert_eq!(rx.try_recv().is_none(), true);
|
||||
assert_eq!(rx.try_recv().is_err(), true);
|
||||
|
||||
test_fetch_redirect_updates_method_runner(tx.clone(), StatusCode::FOUND, Method::POST);
|
||||
assert_eq!(rx.recv().unwrap(), true);
|
||||
assert_eq!(rx.recv().unwrap(), true);
|
||||
assert_eq!(rx.try_recv().is_none(), true);
|
||||
assert_eq!(rx.try_recv().is_err(), true);
|
||||
|
||||
test_fetch_redirect_updates_method_runner(tx.clone(), StatusCode::SEE_OTHER, Method::GET);
|
||||
assert_eq!(rx.recv().unwrap(), true);
|
||||
assert_eq!(rx.recv().unwrap(), true);
|
||||
assert_eq!(rx.try_recv().is_none(), true);
|
||||
assert_eq!(rx.try_recv().is_err(), true);
|
||||
|
||||
let extension = Method::from_bytes(b"FOO").unwrap();
|
||||
|
||||
|
@ -923,18 +923,18 @@ fn test_fetch_redirect_updates_method() {
|
|||
assert_eq!(rx.recv().unwrap(), true);
|
||||
// for MovedPermanently and Found, Method should only be changed if it was Post
|
||||
assert_eq!(rx.recv().unwrap(), false);
|
||||
assert_eq!(rx.try_recv().is_none(), true);
|
||||
assert_eq!(rx.try_recv().is_err(), true);
|
||||
|
||||
test_fetch_redirect_updates_method_runner(tx.clone(), StatusCode::FOUND, extension.clone());
|
||||
assert_eq!(rx.recv().unwrap(), true);
|
||||
assert_eq!(rx.recv().unwrap(), false);
|
||||
assert_eq!(rx.try_recv().is_none(), true);
|
||||
assert_eq!(rx.try_recv().is_err(), true);
|
||||
|
||||
test_fetch_redirect_updates_method_runner(tx.clone(), StatusCode::SEE_OTHER, extension.clone());
|
||||
assert_eq!(rx.recv().unwrap(), true);
|
||||
// for SeeOther, Method should always be changed, so this should be true
|
||||
assert_eq!(rx.recv().unwrap(), true);
|
||||
assert_eq!(rx.try_recv().is_none(), true);
|
||||
assert_eq!(rx.try_recv().is_err(), true);
|
||||
}
|
||||
|
||||
fn response_is_done(response: &Response) -> bool {
|
||||
|
@ -1044,7 +1044,7 @@ fn test_fetch_with_devtools() {
|
|||
let mut request = Request::new(url.clone(), Some(origin), Some(TEST_PIPELINE_ID));
|
||||
request.referrer = Referrer::NoReferrer;
|
||||
|
||||
let (devtools_chan, devtools_port) = channel();
|
||||
let (devtools_chan, devtools_port) = unbounded();
|
||||
|
||||
let _ = fetch(&mut request, Some(devtools_chan));
|
||||
let _ = server.close();
|
||||
|
|
|
@ -7,6 +7,7 @@ use crate::fetch;
|
|||
use crate::fetch_with_context;
|
||||
use crate::make_server;
|
||||
use crate::new_fetch_context;
|
||||
use crossbeam_channel::{unbounded, Receiver};
|
||||
use devtools_traits::HttpRequest as DevtoolsHttpRequest;
|
||||
use devtools_traits::HttpResponse as DevtoolsHttpResponse;
|
||||
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg, NetworkEvent};
|
||||
|
@ -31,7 +32,6 @@ use net::test::replace_host_table;
|
|||
use net_traits::request::{CredentialsMode, Destination, Request, RequestInit, RequestMode};
|
||||
use net_traits::response::ResponseBody;
|
||||
use net_traits::{CookieSource, NetworkError};
|
||||
use servo_channel::{channel, Receiver};
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use std::collections::HashMap;
|
||||
use std::io::Write;
|
||||
|
@ -243,7 +243,7 @@ fn test_request_and_response_data_with_network_messages() {
|
|||
pipeline_id: Some(TEST_PIPELINE_ID),
|
||||
..RequestInit::default()
|
||||
});
|
||||
let (devtools_chan, devtools_port) = channel();
|
||||
let (devtools_chan, devtools_port) = unbounded();
|
||||
let response = fetch(&mut request, Some(devtools_chan));
|
||||
assert!(
|
||||
response
|
||||
|
@ -344,7 +344,7 @@ fn test_request_and_response_message_from_devtool_without_pipeline_id() {
|
|||
pipeline_id: None,
|
||||
..RequestInit::default()
|
||||
});
|
||||
let (devtools_chan, devtools_port) = channel();
|
||||
let (devtools_chan, devtools_port) = unbounded();
|
||||
let response = fetch(&mut request, Some(devtools_chan));
|
||||
assert!(
|
||||
response
|
||||
|
@ -359,7 +359,7 @@ fn test_request_and_response_message_from_devtool_without_pipeline_id() {
|
|||
let _ = server.close();
|
||||
|
||||
// notification received from devtools
|
||||
assert!(devtools_port.try_recv().is_none());
|
||||
assert!(devtools_port.try_recv().is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -388,7 +388,7 @@ fn test_redirected_request_to_devtools() {
|
|||
pipeline_id: Some(TEST_PIPELINE_ID),
|
||||
..RequestInit::default()
|
||||
});
|
||||
let (devtools_chan, devtools_port) = channel();
|
||||
let (devtools_chan, devtools_port) = unbounded();
|
||||
fetch(&mut request, Some(devtools_chan));
|
||||
|
||||
let _ = pre_server.close();
|
||||
|
|
|
@ -19,6 +19,7 @@ mod mime_classifier;
|
|||
mod resource_thread;
|
||||
mod subresource_integrity;
|
||||
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use devtools_traits::DevtoolsControlMsg;
|
||||
use embedder_traits::resources::{self, Resource};
|
||||
use embedder_traits::{EmbedderProxy, EventLoopWaker};
|
||||
|
@ -36,7 +37,6 @@ use net_traits::request::Request;
|
|||
use net_traits::response::Response;
|
||||
use net_traits::FetchTaskTarget;
|
||||
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
|
||||
use servo_channel::{channel, Sender};
|
||||
use servo_url::ServoUrl;
|
||||
use std::net::TcpListener as StdTcpListener;
|
||||
use std::path::PathBuf;
|
||||
|
@ -56,7 +56,7 @@ struct FetchResponseCollector {
|
|||
}
|
||||
|
||||
fn create_embedder_proxy() -> EmbedderProxy {
|
||||
let (sender, _) = channel();
|
||||
let (sender, _) = unbounded();
|
||||
let event_loop_waker = || {
|
||||
struct DummyEventLoopWaker {}
|
||||
impl DummyEventLoopWaker {
|
||||
|
@ -111,7 +111,7 @@ fn fetch(request: &mut Request, dc: Option<Sender<DevtoolsControlMsg>>) -> Respo
|
|||
}
|
||||
|
||||
fn fetch_with_context(request: &mut Request, context: &FetchContext) -> Response {
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
let mut target = FetchResponseCollector { sender: sender };
|
||||
|
||||
methods::fetch(request, &mut target, context);
|
||||
|
@ -120,7 +120,7 @@ fn fetch_with_context(request: &mut Request, context: &FetchContext) -> Response
|
|||
}
|
||||
|
||||
fn fetch_with_cors_cache(request: &mut Request, cache: &mut CorsCache) -> Response {
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
let mut target = FetchResponseCollector { sender: sender };
|
||||
|
||||
methods::fetch_with_cors_cache(request, cache, &mut target, &new_fetch_context(None, None));
|
||||
|
|
|
@ -15,12 +15,12 @@ energy-profiling = ["energymon", "energy-monitor"]
|
|||
|
||||
[dependencies]
|
||||
bincode = "1"
|
||||
crossbeam-channel = "0.3"
|
||||
energy-monitor = {version = "0.2.0", optional = true}
|
||||
energymon = {git = "https://github.com/energymon/energymon-rust.git", optional = true}
|
||||
ipc-channel = "0.11"
|
||||
log = "0.4"
|
||||
serde = "1.0"
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_config = {path = "../config"}
|
||||
signpost = {git = "https://github.com/pcwalton/signpost.git"}
|
||||
time = "0.1.12"
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
#![deny(missing_docs)]
|
||||
|
||||
use crossbeam_channel::Sender;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use servo_channel::Sender;
|
||||
use std::marker::Send;
|
||||
|
||||
/// A trait to abstract away the various kinds of message senders we use.
|
||||
|
|
|
@ -42,6 +42,7 @@ canvas_traits = {path = "../canvas_traits"}
|
|||
caseless = "0.2"
|
||||
cookie = "0.11"
|
||||
chrono = "0.4"
|
||||
crossbeam-channel = "0.3"
|
||||
cssparser = "0.25"
|
||||
deny_public_fields = {path = "../deny_public_fields"}
|
||||
devtools_traits = {path = "../devtools_traits"}
|
||||
|
@ -94,7 +95,6 @@ serde_bytes = "0.10"
|
|||
servo_allocator = {path = "../allocator"}
|
||||
servo_arc = {path = "../servo_arc"}
|
||||
servo_atoms = {path = "../atoms"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_config = {path = "../config"}
|
||||
servo_geometry = {path = "../geometry" }
|
||||
servo-media = {git = "https://github.com/servo/media"}
|
||||
|
|
|
@ -11,8 +11,8 @@ use crate::dom::worker::TrustedWorkerAddress;
|
|||
use crate::dom::workerglobalscope::WorkerGlobalScope;
|
||||
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort};
|
||||
use crate::task_queue::{QueuedTaskConversion, TaskQueue};
|
||||
use crossbeam_channel::{Receiver, Sender};
|
||||
use devtools_traits::DevtoolScriptControlMsg;
|
||||
use servo_channel::{Receiver, Sender};
|
||||
|
||||
/// A ScriptChan that can be cloned freely and will silently send a TrustedWorkerAddress with
|
||||
/// common event loop messages. While this SendableWorkerScriptChan is alive, the associated
|
||||
|
@ -69,9 +69,9 @@ impl ScriptChan for WorkerThreadWorkerChan {
|
|||
impl ScriptPort for Receiver<DedicatedWorkerScriptMsg> {
|
||||
fn recv(&self) -> Result<CommonScriptMsg, ()> {
|
||||
let common_msg = match self.recv() {
|
||||
Some(DedicatedWorkerScriptMsg::CommonWorker(_worker, common_msg)) => common_msg,
|
||||
None => return Err(()),
|
||||
Some(DedicatedWorkerScriptMsg::WakeUp) => panic!("unexpected worker event message!"),
|
||||
Ok(DedicatedWorkerScriptMsg::CommonWorker(_worker, common_msg)) => common_msg,
|
||||
Err(_) => return Err(()),
|
||||
Ok(DedicatedWorkerScriptMsg::WakeUp) => panic!("unexpected worker event message!"),
|
||||
};
|
||||
match common_msg {
|
||||
WorkerScriptMsg::Common(script_msg) => Ok(script_msg),
|
||||
|
@ -108,17 +108,18 @@ pub fn run_worker_event_loop<T, TimerMsg, WorkerMsg, Event>(
|
|||
let scope = worker_scope.upcast::<WorkerGlobalScope>();
|
||||
let timer_event_port = worker_scope.timer_event_port();
|
||||
let devtools_port = match scope.from_devtools_sender() {
|
||||
Some(_) => Some(scope.from_devtools_receiver().select()),
|
||||
Some(_) => Some(scope.from_devtools_receiver()),
|
||||
None => None,
|
||||
};
|
||||
let task_queue = worker_scope.task_queue();
|
||||
let event = select! {
|
||||
recv(task_queue.select(), msg) => {
|
||||
recv(task_queue.select()) -> msg => {
|
||||
task_queue.take_tasks(msg.unwrap());
|
||||
worker_scope.from_worker_msg(task_queue.recv().unwrap())
|
||||
},
|
||||
recv(timer_event_port.select(), msg) => worker_scope.from_timer_msg(msg.unwrap()),
|
||||
recv(devtools_port, msg) => worker_scope.from_devtools_msg(msg.unwrap()),
|
||||
recv(timer_event_port) -> msg => worker_scope.from_timer_msg(msg.unwrap()),
|
||||
recv(devtools_port.unwrap_or(&crossbeam_channel::never())) -> msg =>
|
||||
worker_scope.from_devtools_msg(msg.unwrap()),
|
||||
};
|
||||
let mut sequential = vec![];
|
||||
sequential.push(event);
|
||||
|
@ -131,14 +132,15 @@ pub fn run_worker_event_loop<T, TimerMsg, WorkerMsg, Event>(
|
|||
// Batch all events that are ready.
|
||||
// The task queue will throttle non-priority tasks if necessary.
|
||||
match task_queue.try_recv() {
|
||||
None => match timer_event_port.try_recv() {
|
||||
None => match devtools_port.and_then(|port| port.try_recv()) {
|
||||
None => break,
|
||||
Some(ev) => sequential.push(worker_scope.from_devtools_msg(ev)),
|
||||
Err(_) => match timer_event_port.try_recv() {
|
||||
Err(_) => match devtools_port.map(|port| port.try_recv()) {
|
||||
None => {},
|
||||
Some(Err(_)) => break,
|
||||
Some(Ok(ev)) => sequential.push(worker_scope.from_devtools_msg(ev)),
|
||||
},
|
||||
Some(ev) => sequential.push(worker_scope.from_timer_msg(ev)),
|
||||
Ok(ev) => sequential.push(worker_scope.from_timer_msg(ev)),
|
||||
},
|
||||
Some(ev) => sequential.push(worker_scope.from_worker_msg(ev)),
|
||||
Ok(ev) => sequential.push(worker_scope.from_worker_msg(ev)),
|
||||
}
|
||||
}
|
||||
// Step 3
|
||||
|
|
|
@ -49,6 +49,7 @@ use crate::dom::bindings::utils::WindowProxyHandler;
|
|||
use crate::dom::document::PendingRestyle;
|
||||
use crate::dom::htmlimageelement::SourceSet;
|
||||
use crate::dom::htmlmediaelement::MediaFrameRenderer;
|
||||
use crossbeam_channel::{Receiver, Sender};
|
||||
use cssparser::RGBA;
|
||||
use devtools_traits::{CSSError, TimelineMarkerType, WorkerId};
|
||||
use encoding_rs::{Decoder, Encoding};
|
||||
|
@ -93,7 +94,6 @@ use selectors::matching::ElementSelectorFlags;
|
|||
use serde::{Deserialize, Serialize};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::{Receiver, Sender};
|
||||
use servo_media::audio::analyser_node::AnalysisEngine;
|
||||
use servo_media::audio::buffer_source_node::AudioBuffer;
|
||||
use servo_media::audio::context::AudioContext;
|
||||
|
|
|
@ -26,6 +26,7 @@ use crate::script_runtime::ScriptThreadEventCategory::WorkerEvent;
|
|||
use crate::script_runtime::{new_rt_and_cx, CommonScriptMsg, Runtime, ScriptChan, ScriptPort};
|
||||
use crate::task_queue::{QueuedTask, QueuedTaskConversion, TaskQueue};
|
||||
use crate::task_source::TaskSourceName;
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use devtools_traits::DevtoolScriptControlMsg;
|
||||
use dom_struct::dom_struct;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
|
@ -38,7 +39,6 @@ use msg::constellation_msg::TopLevelBrowsingContextId;
|
|||
use net_traits::request::{CredentialsMode, Destination, RequestInit};
|
||||
use net_traits::{load_whole_resource, IpcSend};
|
||||
use script_traits::{TimerEvent, TimerSource, WorkerGlobalScopeInit, WorkerScriptLoadOrigin};
|
||||
use servo_channel::{channel, route_ipc_receiver_to_new_servo_sender, Receiver, Sender};
|
||||
use servo_rand::random;
|
||||
use servo_url::ServoUrl;
|
||||
use std::mem::replace;
|
||||
|
@ -329,10 +329,13 @@ impl DedicatedWorkerGlobalScope {
|
|||
|
||||
let runtime = unsafe { new_rt_and_cx() };
|
||||
|
||||
let (devtools_mpsc_chan, devtools_mpsc_port) = channel();
|
||||
route_ipc_receiver_to_new_servo_sender(from_devtools_receiver, devtools_mpsc_chan);
|
||||
let (devtools_mpsc_chan, devtools_mpsc_port) = unbounded();
|
||||
ROUTER.route_ipc_receiver_to_crossbeam_sender(
|
||||
from_devtools_receiver,
|
||||
devtools_mpsc_chan,
|
||||
);
|
||||
|
||||
let (timer_tx, timer_rx) = channel();
|
||||
let (timer_tx, timer_rx) = unbounded();
|
||||
let (timer_ipc_chan, timer_ipc_port) = ipc::channel().unwrap();
|
||||
let worker_for_route = worker.clone();
|
||||
ROUTER.add_route(
|
||||
|
@ -404,7 +407,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
}
|
||||
|
||||
pub fn new_script_pair(&self) -> (Box<dyn ScriptChan + Send>, Box<dyn ScriptPort + Send>) {
|
||||
let (tx, rx) = channel();
|
||||
let (tx, rx) = unbounded();
|
||||
let chan = Box::new(SendableWorkerScriptChan {
|
||||
sender: tx,
|
||||
worker: self.worker.borrow().as_ref().unwrap().clone(),
|
||||
|
|
|
@ -23,6 +23,7 @@ use crate::dom::worklet::WorkletExecutor;
|
|||
use crate::dom::workletglobalscope::WorkletGlobalScope;
|
||||
use crate::dom::workletglobalscope::WorkletGlobalScopeInit;
|
||||
use crate::dom::workletglobalscope::WorkletTask;
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use dom_struct::dom_struct;
|
||||
use euclid::TypedScale;
|
||||
use euclid::TypedSize2D;
|
||||
|
@ -49,8 +50,6 @@ use profile_traits::ipc;
|
|||
use script_traits::Painter;
|
||||
use script_traits::{DrawAPaintImageResult, PaintWorkletError};
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::base_channel;
|
||||
use servo_channel::{channel, Sender};
|
||||
use servo_config::prefs::PREFS;
|
||||
use servo_url::ServoUrl;
|
||||
use std::cell::Cell;
|
||||
|
@ -426,7 +425,7 @@ impl PaintWorkletGlobalScope {
|
|||
arguments: Vec<String>,
|
||||
) -> Result<DrawAPaintImageResult, PaintWorkletError> {
|
||||
let name = self.name.clone();
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
let task = PaintWorkletTask::DrawAPaintImage(
|
||||
name,
|
||||
size,
|
||||
|
@ -445,12 +444,9 @@ impl PaintWorkletGlobalScope {
|
|||
.as_u64()
|
||||
.unwrap_or(10u64);
|
||||
|
||||
select! {
|
||||
recv(base_channel::after(Duration::from_millis(timeout))) => {
|
||||
Err(PaintWorkletError::Timeout)
|
||||
}
|
||||
recv(receiver.select(), msg) => msg.ok_or(PaintWorkletError::Timeout)
|
||||
}
|
||||
receiver
|
||||
.recv_timeout(Duration::from_millis(timeout))
|
||||
.map_err(|e| PaintWorkletError::from(e))
|
||||
}
|
||||
}
|
||||
Box::new(WorkletPainter {
|
||||
|
|
|
@ -22,9 +22,11 @@ use crate::dom::workerglobalscope::WorkerGlobalScope;
|
|||
use crate::script_runtime::{new_rt_and_cx, CommonScriptMsg, Runtime, ScriptChan};
|
||||
use crate::task_queue::{QueuedTask, QueuedTaskConversion, TaskQueue};
|
||||
use crate::task_source::TaskSourceName;
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use devtools_traits::DevtoolScriptControlMsg;
|
||||
use dom_struct::dom_struct;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use js::jsapi::{JSAutoCompartment, JSContext, JS_AddInterruptCallback};
|
||||
use js::jsval::UndefinedValue;
|
||||
use net_traits::request::{CredentialsMode, Destination, RequestInit};
|
||||
|
@ -32,7 +34,6 @@ use net_traits::{load_whole_resource, CustomResponseMediator, IpcSend};
|
|||
use script_traits::{
|
||||
ScopeThings, ServiceWorkerMsg, TimerEvent, WorkerGlobalScopeInit, WorkerScriptLoadOrigin,
|
||||
};
|
||||
use servo_channel::{channel, route_ipc_receiver_to_new_servo_sender, Receiver, Sender};
|
||||
use servo_config::prefs::PREFS;
|
||||
use servo_rand::random;
|
||||
use servo_url::ServoUrl;
|
||||
|
@ -293,11 +294,12 @@ impl ServiceWorkerGlobalScope {
|
|||
|
||||
let runtime = unsafe { new_rt_and_cx() };
|
||||
|
||||
let (devtools_mpsc_chan, devtools_mpsc_port) = channel();
|
||||
route_ipc_receiver_to_new_servo_sender(devtools_receiver, devtools_mpsc_chan);
|
||||
let (devtools_mpsc_chan, devtools_mpsc_port) = unbounded();
|
||||
ROUTER
|
||||
.route_ipc_receiver_to_crossbeam_sender(devtools_receiver, devtools_mpsc_chan);
|
||||
// TODO XXXcreativcoder use this timer_ipc_port, when we have a service worker instance here
|
||||
let (timer_ipc_chan, _timer_ipc_port) = ipc::channel().unwrap();
|
||||
let (timer_chan, timer_port) = channel();
|
||||
let (timer_chan, timer_port) = unbounded();
|
||||
let global = ServiceWorkerGlobalScope::new(
|
||||
init,
|
||||
url,
|
||||
|
|
|
@ -20,6 +20,7 @@ use crate::dom::node::Node;
|
|||
use crate::dom::processinginstruction::ProcessingInstruction;
|
||||
use crate::dom::servoparser::{create_element_for_token, ElementAttribute, ParsingAlgorithm};
|
||||
use crate::dom::virtualmethods::vtable_for;
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use html5ever::buffer_queue::BufferQueue;
|
||||
use html5ever::tendril::fmt::UTF8;
|
||||
use html5ever::tendril::{SendTendril, StrTendril, Tendril};
|
||||
|
@ -29,7 +30,6 @@ use html5ever::tree_builder::{
|
|||
};
|
||||
use html5ever::tree_builder::{TreeBuilder, TreeBuilderOpts};
|
||||
use html5ever::{Attribute as HtmlAttribute, ExpandedName, QualName};
|
||||
use servo_channel::{channel, Receiver, Sender};
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::Cow;
|
||||
use std::cell::Cell;
|
||||
|
@ -215,9 +215,9 @@ impl Tokenizer {
|
|||
fragment_context: Option<super::FragmentContext>,
|
||||
) -> Self {
|
||||
// Messages from the Tokenizer (main thread) to HtmlTokenizer (parser thread)
|
||||
let (to_html_tokenizer_sender, html_tokenizer_receiver) = channel();
|
||||
let (to_html_tokenizer_sender, html_tokenizer_receiver) = unbounded();
|
||||
// Messages from HtmlTokenizer and Sink (parser thread) to Tokenizer (main thread)
|
||||
let (to_tokenizer_sender, tokenizer_receiver) = channel();
|
||||
let (to_tokenizer_sender, tokenizer_receiver) = unbounded();
|
||||
|
||||
let mut tokenizer = Tokenizer {
|
||||
document: Dom::from_ref(document),
|
||||
|
|
|
@ -10,10 +10,10 @@ use crate::dom::bindings::str::DOMString;
|
|||
use crate::dom::worklet::WorkletExecutor;
|
||||
use crate::dom::workletglobalscope::WorkletGlobalScope;
|
||||
use crate::dom::workletglobalscope::WorkletGlobalScopeInit;
|
||||
use crossbeam_channel::Sender;
|
||||
use dom_struct::dom_struct;
|
||||
use js::rust::Runtime;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use servo_channel::Sender;
|
||||
use servo_url::ServoUrl;
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
|
|
@ -33,11 +33,11 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CommonScriptMsg;
|
||||
use crate::script_runtime::ScriptThreadEventCategory::WebVREvent;
|
||||
use crate::task_source::TaskSourceName;
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use dom_struct::dom_struct;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use profile_traits::ipc;
|
||||
use serde_bytes::ByteBuf;
|
||||
use servo_channel::{channel, Sender};
|
||||
use std::cell::Cell;
|
||||
use std::mem;
|
||||
use std::ops::Deref;
|
||||
|
@ -538,7 +538,7 @@ impl VRDisplay {
|
|||
thread::Builder::new()
|
||||
.name("WebVR_RAF".into())
|
||||
.spawn(move || {
|
||||
let (raf_sender, raf_receiver) = channel();
|
||||
let (raf_sender, raf_receiver) = unbounded();
|
||||
let mut near = near_init;
|
||||
let mut far = far_init;
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ use crate::task_manager::TaskManager;
|
|||
use crate::task_source::TaskSourceName;
|
||||
use crate::timers::{IsInterval, TimerCallback};
|
||||
use crate::webdriver_handlers::jsval_to_webdriver;
|
||||
use crossbeam_channel::{unbounded, Sender, TryRecvError};
|
||||
use cssparser::{Parser, ParserInput};
|
||||
use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType};
|
||||
use dom_struct::dom_struct;
|
||||
|
@ -104,7 +105,6 @@ use script_traits::{ConstellationControlMsg, DocumentState, LoadData};
|
|||
use script_traits::{ScriptMsg, ScriptToConstellationChan, ScrollState, TimerEvent, TimerEventId};
|
||||
use script_traits::{TimerSchedulerMsg, UntrustedNodeAddress, WindowSizeData, WindowSizeType};
|
||||
use selectors::attr::CaseSensitivity;
|
||||
use servo_channel::{channel, Sender};
|
||||
use servo_config::opts;
|
||||
use servo_geometry::{f32_rect_to_au_rect, MaxRect};
|
||||
use servo_url::{Host, ImmutableOrigin, MutableOrigin, ServoUrl};
|
||||
|
@ -348,7 +348,7 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn new_script_pair(&self) -> (Box<dyn ScriptChan + Send>, Box<dyn ScriptPort + Send>) {
|
||||
let (tx, rx) = channel();
|
||||
let (tx, rx) = unbounded();
|
||||
(Box::new(SendableMainThreadScriptChan(tx)), Box::new(rx))
|
||||
}
|
||||
|
||||
|
@ -1394,7 +1394,7 @@ impl Window {
|
|||
};
|
||||
|
||||
// Layout will let us know when it's done.
|
||||
let (join_chan, join_port) = channel();
|
||||
let (join_chan, join_port) = unbounded();
|
||||
|
||||
// On debug mode, print the reflow event information.
|
||||
if opts::get().relayout_event {
|
||||
|
@ -1427,16 +1427,15 @@ impl Window {
|
|||
|
||||
debug!("script: layout forked");
|
||||
|
||||
let complete = select! {
|
||||
recv(join_port.select(), msg) => if let Some(reflow_complete) = msg {
|
||||
reflow_complete
|
||||
} else {
|
||||
panic!("Layout thread failed while script was waiting for a result.");
|
||||
},
|
||||
default => {
|
||||
let complete = match join_port.try_recv() {
|
||||
Err(TryRecvError::Empty) => {
|
||||
info!("script: waiting on layout");
|
||||
join_port.recv().unwrap()
|
||||
}
|
||||
},
|
||||
Ok(reflow_complete) => reflow_complete,
|
||||
Err(TryRecvError::Disconnected) => {
|
||||
panic!("Layout thread failed while script was waiting for a result.");
|
||||
},
|
||||
};
|
||||
|
||||
debug!("script: layout joined");
|
||||
|
@ -2033,7 +2032,7 @@ impl Window {
|
|||
webrender_api_sender: RenderApiSender,
|
||||
) -> DomRoot<Self> {
|
||||
let layout_rpc: Box<dyn LayoutRPC + Send> = {
|
||||
let (rpc_send, rpc_recv) = channel();
|
||||
let (rpc_send, rpc_recv) = unbounded();
|
||||
layout_chan.send(Msg::GetRPC(rpc_send)).unwrap();
|
||||
rpc_recv.recv().unwrap()
|
||||
};
|
||||
|
|
|
@ -21,6 +21,7 @@ use crate::dom::globalscope::GlobalScope;
|
|||
use crate::dom::messageevent::MessageEvent;
|
||||
use crate::dom::workerglobalscope::prepare_workerscope_init;
|
||||
use crate::task::TaskOnce;
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use devtools_traits::{DevtoolsPageInfo, ScriptToDevtoolsControlMsg};
|
||||
use dom_struct::dom_struct;
|
||||
use ipc_channel::ipc;
|
||||
|
@ -28,7 +29,6 @@ use js::jsapi::{JSAutoCompartment, JSContext, JS_RequestInterruptCallback};
|
|||
use js::jsval::UndefinedValue;
|
||||
use js::rust::HandleValue;
|
||||
use script_traits::WorkerScriptLoadOrigin;
|
||||
use servo_channel::{channel, Sender};
|
||||
use std::cell::Cell;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
@ -79,7 +79,7 @@ impl Worker {
|
|||
Err(_) => return Err(Error::Syntax),
|
||||
};
|
||||
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
let closing = Arc::new(AtomicBool::new(false));
|
||||
let worker = Worker::new(global, sender.clone(), closing.clone());
|
||||
global.track_worker(closing.clone());
|
||||
|
|
|
@ -32,6 +32,7 @@ use crate::task_source::performance_timeline::PerformanceTimelineTaskSource;
|
|||
use crate::task_source::remote_event::RemoteEventTaskSource;
|
||||
use crate::task_source::websocket::WebsocketTaskSource;
|
||||
use crate::timers::{IsInterval, TimerCallback};
|
||||
use crossbeam_channel::Receiver;
|
||||
use devtools_traits::{DevtoolScriptControlMsg, WorkerId};
|
||||
use dom_struct::dom_struct;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
|
@ -44,7 +45,6 @@ use net_traits::request::{CredentialsMode, Destination, RequestInit as NetReques
|
|||
use net_traits::{load_whole_resource, IpcSend};
|
||||
use script_traits::WorkerGlobalScopeInit;
|
||||
use script_traits::{TimerEvent, TimerEventId};
|
||||
use servo_channel::Receiver;
|
||||
use servo_url::{MutableOrigin, ServoUrl};
|
||||
use std::default::Default;
|
||||
use std::rc::Rc;
|
||||
|
|
|
@ -39,6 +39,7 @@ use crate::script_runtime::ScriptThreadEventCategory;
|
|||
use crate::script_thread::{MainThreadScriptMsg, ScriptThread};
|
||||
use crate::task::TaskBox;
|
||||
use crate::task_source::TaskSourceName;
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use dom_struct::dom_struct;
|
||||
use js::jsapi::JSGCParamKey;
|
||||
use js::jsapi::JSTracer;
|
||||
|
@ -50,7 +51,6 @@ use net_traits::request::Destination;
|
|||
use net_traits::request::RequestInit;
|
||||
use net_traits::request::RequestMode;
|
||||
use net_traits::IpcSend;
|
||||
use servo_channel::{channel, Receiver, Sender};
|
||||
use servo_url::ImmutableOrigin;
|
||||
use servo_url::ServoUrl;
|
||||
use std::cmp::max;
|
||||
|
@ -334,7 +334,7 @@ impl WorkletThreadPool {
|
|||
|
||||
/// For testing.
|
||||
pub fn test_worklet_lookup(&self, id: WorkletId, key: String) -> Option<String> {
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
let msg = WorkletData::Task(id, WorkletTask::Test(TestWorkletTask::Lookup(key, sender)));
|
||||
let _ = self.primary_sender.send(msg);
|
||||
receiver.recv().expect("Test worklet has died?")
|
||||
|
@ -388,7 +388,7 @@ struct WorkletThreadRole {
|
|||
|
||||
impl WorkletThreadRole {
|
||||
fn new(is_hot_backup: bool, is_cold_backup: bool) -> WorkletThreadRole {
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
WorkletThreadRole {
|
||||
sender: sender,
|
||||
receiver: receiver,
|
||||
|
@ -452,7 +452,7 @@ impl WorkletThread {
|
|||
#[allow(unsafe_code)]
|
||||
#[allow(unrooted_must_root)]
|
||||
fn spawn(role: WorkletThreadRole, init: WorkletThreadInit) -> Sender<WorkletControl> {
|
||||
let (control_sender, control_receiver) = channel();
|
||||
let (control_sender, control_receiver) = unbounded();
|
||||
// TODO: name this thread
|
||||
thread::spawn(move || {
|
||||
// TODO: add a new IN_WORKLET thread state?
|
||||
|
@ -522,12 +522,12 @@ impl WorkletThread {
|
|||
if let Some(control) = self.control_buffer.take() {
|
||||
self.process_control(control);
|
||||
}
|
||||
while let Some(control) = self.control_receiver.try_recv() {
|
||||
while let Ok(control) = self.control_receiver.try_recv() {
|
||||
self.process_control(control);
|
||||
}
|
||||
self.gc();
|
||||
} else if self.control_buffer.is_none() {
|
||||
if let Some(control) = self.control_receiver.try_recv() {
|
||||
if let Ok(control) = self.control_receiver.try_recv() {
|
||||
self.control_buffer = Some(control);
|
||||
let msg = WorkletData::StartSwapRoles(self.role.sender.clone());
|
||||
let _ = self.cold_backup_sender.send(msg);
|
||||
|
|
|
@ -11,6 +11,7 @@ use crate::dom::testworkletglobalscope::TestWorkletGlobalScope;
|
|||
use crate::dom::testworkletglobalscope::TestWorkletTask;
|
||||
use crate::dom::worklet::WorkletExecutor;
|
||||
use crate::script_thread::MainThreadScriptMsg;
|
||||
use crossbeam_channel::Sender;
|
||||
use devtools_traits::ScriptToDevtoolsControlMsg;
|
||||
use dom_struct::dom_struct;
|
||||
use ipc_channel::ipc;
|
||||
|
@ -26,7 +27,6 @@ use profile_traits::time;
|
|||
use script_traits::{Painter, ScriptMsg};
|
||||
use script_traits::{ScriptToConstellationChan, TimerSchedulerMsg};
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::Sender;
|
||||
use servo_url::ImmutableOrigin;
|
||||
use servo_url::MutableOrigin;
|
||||
use servo_url::ServoUrl;
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
#[macro_use]
|
||||
extern crate crossbeam_channel;
|
||||
#[macro_use]
|
||||
extern crate cssparser;
|
||||
#[macro_use]
|
||||
extern crate deny_public_fields;
|
||||
|
@ -46,8 +48,6 @@ extern crate profile_traits;
|
|||
#[macro_use]
|
||||
extern crate servo_atoms;
|
||||
#[macro_use]
|
||||
extern crate servo_channel;
|
||||
#[macro_use]
|
||||
extern crate style;
|
||||
|
||||
#[macro_use]
|
||||
|
|
|
@ -83,6 +83,7 @@ use crate::task_source::user_interaction::UserInteractionTaskSource;
|
|||
use crate::task_source::websocket::WebsocketTaskSource;
|
||||
use crate::task_source::TaskSourceName;
|
||||
use crate::webdriver_handlers;
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use devtools_traits::CSSError;
|
||||
use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo};
|
||||
use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId};
|
||||
|
@ -93,6 +94,7 @@ use headers_ext::LastModified;
|
|||
use headers_ext::ReferrerPolicy as ReferrerPolicyHeader;
|
||||
use hyper_serde::Serde;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use js::glue::GetWindowProxyClass;
|
||||
use js::jsapi::{JSAutoCompartment, JSContext, JS_SetWrapObjectCallbacks};
|
||||
use js::jsapi::{JSTracer, SetWindowProxyClass};
|
||||
|
@ -122,10 +124,6 @@ use script_traits::{ScriptToConstellationChan, TimerEvent, TimerSchedulerMsg};
|
|||
use script_traits::{TimerSource, TouchEventType, TouchId, UntrustedNodeAddress};
|
||||
use script_traits::{UpdatePipelineIdReason, WindowSizeData, WindowSizeType};
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::{channel, Receiver, Sender};
|
||||
use servo_channel::{
|
||||
route_ipc_receiver_to_new_servo_receiver, route_ipc_receiver_to_new_servo_sender,
|
||||
};
|
||||
use servo_config::opts;
|
||||
use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl};
|
||||
use std::cell::Cell;
|
||||
|
@ -321,39 +319,39 @@ impl OpaqueSender<CommonScriptMsg> for Box<dyn ScriptChan + Send> {
|
|||
|
||||
impl ScriptPort for Receiver<CommonScriptMsg> {
|
||||
fn recv(&self) -> Result<CommonScriptMsg, ()> {
|
||||
self.recv().ok_or(())
|
||||
self.recv().map_err(|_| ())
|
||||
}
|
||||
}
|
||||
|
||||
impl ScriptPort for Receiver<MainThreadScriptMsg> {
|
||||
fn recv(&self) -> Result<CommonScriptMsg, ()> {
|
||||
match self.recv() {
|
||||
Some(MainThreadScriptMsg::Common(script_msg)) => Ok(script_msg),
|
||||
Some(_) => panic!("unexpected main thread event message!"),
|
||||
None => Err(()),
|
||||
Ok(MainThreadScriptMsg::Common(script_msg)) => Ok(script_msg),
|
||||
Ok(_) => panic!("unexpected main thread event message!"),
|
||||
Err(_) => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ScriptPort for Receiver<(TrustedWorkerAddress, CommonScriptMsg)> {
|
||||
fn recv(&self) -> Result<CommonScriptMsg, ()> {
|
||||
self.recv().map(|(_, msg)| msg).ok_or(())
|
||||
self.recv().map(|(_, msg)| msg).map_err(|_| ())
|
||||
}
|
||||
}
|
||||
|
||||
impl ScriptPort for Receiver<(TrustedWorkerAddress, MainThreadScriptMsg)> {
|
||||
fn recv(&self) -> Result<CommonScriptMsg, ()> {
|
||||
match self.recv().map(|(_, msg)| msg) {
|
||||
Some(MainThreadScriptMsg::Common(script_msg)) => Ok(script_msg),
|
||||
Some(_) => panic!("unexpected main thread event message!"),
|
||||
None => Err(()),
|
||||
Ok(MainThreadScriptMsg::Common(script_msg)) => Ok(script_msg),
|
||||
Ok(_) => panic!("unexpected main thread event message!"),
|
||||
Err(_) => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ScriptPort for Receiver<(TrustedServiceWorkerAddress, CommonScriptMsg)> {
|
||||
fn recv(&self) -> Result<CommonScriptMsg, ()> {
|
||||
self.recv().map(|(_, msg)| msg).ok_or(())
|
||||
self.recv().map(|(_, msg)| msg).map_err(|_| ())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -648,9 +646,9 @@ impl ScriptThreadFactory for ScriptThread {
|
|||
state: InitialScriptState,
|
||||
load_data: LoadData,
|
||||
) -> (Sender<message::Msg>, Receiver<message::Msg>) {
|
||||
let (script_chan, script_port) = channel();
|
||||
let (script_chan, script_port) = unbounded();
|
||||
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
let layout_chan = sender.clone();
|
||||
thread::Builder::new()
|
||||
.name(format!("ScriptThread {:?}", state.id))
|
||||
|
@ -1004,16 +1002,17 @@ impl ScriptThread {
|
|||
|
||||
// Ask the router to proxy IPC messages from the devtools to us.
|
||||
let (ipc_devtools_sender, ipc_devtools_receiver) = ipc::channel().unwrap();
|
||||
let devtools_port = route_ipc_receiver_to_new_servo_receiver(ipc_devtools_receiver);
|
||||
let devtools_port =
|
||||
ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(ipc_devtools_receiver);
|
||||
|
||||
let (timer_event_chan, timer_event_port) = channel();
|
||||
let (timer_event_chan, timer_event_port) = unbounded();
|
||||
|
||||
// Ask the router to proxy IPC messages from the control port to us.
|
||||
let control_port = route_ipc_receiver_to_new_servo_receiver(state.control_port);
|
||||
let control_port = ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(state.control_port);
|
||||
|
||||
let boxed_script_sender = Box::new(MainThreadScriptChan(chan.clone()));
|
||||
|
||||
let (image_cache_channel, image_cache_port) = channel();
|
||||
let (image_cache_channel, image_cache_port) = unbounded();
|
||||
|
||||
let task_queue = TaskQueue::new(port, chan.clone());
|
||||
|
||||
|
@ -1130,14 +1129,15 @@ impl ScriptThread {
|
|||
// Receive at least one message so we don't spinloop.
|
||||
debug!("Waiting for event.");
|
||||
let mut event = select! {
|
||||
recv(self.task_queue.select(), msg) => {
|
||||
recv(self.task_queue.select()) -> msg => {
|
||||
self.task_queue.take_tasks(msg.unwrap());
|
||||
FromScript(self.task_queue.recv().unwrap())
|
||||
},
|
||||
recv(self.control_port.select(), msg) => FromConstellation(msg.unwrap()),
|
||||
recv(self.timer_event_port.select(), msg) => FromScheduler(msg.unwrap()),
|
||||
recv(self.devtools_chan.as_ref().map(|_| self.devtools_port.select()), msg) => FromDevtools(msg.unwrap()),
|
||||
recv(self.image_cache_port.select(), msg) => FromImageCache(msg.unwrap()),
|
||||
recv(self.control_port) -> msg => FromConstellation(msg.unwrap()),
|
||||
recv(self.timer_event_port) -> msg => FromScheduler(msg.unwrap()),
|
||||
recv(self.devtools_chan.as_ref().map(|_| &self.devtools_port).unwrap_or(&crossbeam_channel::never())) -> msg
|
||||
=> FromDevtools(msg.unwrap()),
|
||||
recv(self.image_cache_port) -> msg => FromImageCache(msg.unwrap()),
|
||||
};
|
||||
debug!("Got event.");
|
||||
|
||||
|
@ -1221,20 +1221,20 @@ impl ScriptThread {
|
|||
// and check for more resize events. If there are no events pending, we'll move
|
||||
// on and execute the sequential non-resize events we've seen.
|
||||
match self.control_port.try_recv() {
|
||||
None => match self.task_queue.try_recv() {
|
||||
None => match self.timer_event_port.try_recv() {
|
||||
None => match self.devtools_port.try_recv() {
|
||||
None => match self.image_cache_port.try_recv() {
|
||||
None => break,
|
||||
Some(ev) => event = FromImageCache(ev),
|
||||
Err(_) => match self.task_queue.try_recv() {
|
||||
Err(_) => match self.timer_event_port.try_recv() {
|
||||
Err(_) => match self.devtools_port.try_recv() {
|
||||
Err(_) => match self.image_cache_port.try_recv() {
|
||||
Err(_) => break,
|
||||
Ok(ev) => event = FromImageCache(ev),
|
||||
},
|
||||
Some(ev) => event = FromDevtools(ev),
|
||||
Ok(ev) => event = FromDevtools(ev),
|
||||
},
|
||||
Some(ev) => event = FromScheduler(ev),
|
||||
Ok(ev) => event = FromScheduler(ev),
|
||||
},
|
||||
Some(ev) => event = FromScript(ev),
|
||||
Ok(ev) => event = FromScript(ev),
|
||||
},
|
||||
Some(ev) => event = FromConstellation(ev),
|
||||
Ok(ev) => event = FromConstellation(ev),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1843,7 +1843,7 @@ impl ScriptThread {
|
|||
layout_threads,
|
||||
} = new_layout_info;
|
||||
|
||||
let layout_pair = channel();
|
||||
let layout_pair = unbounded();
|
||||
let layout_chan = layout_pair.0.clone();
|
||||
|
||||
let msg = message::Msg::CreateLayoutThread(NewLayoutThreadInfo {
|
||||
|
@ -2253,7 +2253,7 @@ impl ScriptThread {
|
|||
// We shut down layout before removing the document,
|
||||
// since layout might still be in the middle of laying it out.
|
||||
debug!("preparing to shut down layout for page {}", id);
|
||||
let (response_chan, response_port) = channel();
|
||||
let (response_chan, response_port) = unbounded();
|
||||
chan.send(message::Msg::PrepareToExit(response_chan)).ok();
|
||||
let _ = response_port.recv();
|
||||
|
||||
|
@ -2571,7 +2571,10 @@ impl ScriptThread {
|
|||
let MainThreadScriptChan(ref sender) = self.chan;
|
||||
|
||||
let (ipc_timer_event_chan, ipc_timer_event_port) = ipc::channel().unwrap();
|
||||
route_ipc_receiver_to_new_servo_sender(ipc_timer_event_port, self.timer_event_chan.clone());
|
||||
ROUTER.route_ipc_receiver_to_crossbeam_sender(
|
||||
ipc_timer_event_port,
|
||||
self.timer_event_chan.clone(),
|
||||
);
|
||||
|
||||
let origin = if final_url.as_str() == "about:blank" {
|
||||
incomplete.origin.clone()
|
||||
|
|
|
@ -11,11 +11,12 @@ use crate::dom::abstractworker::WorkerScriptMsg;
|
|||
use crate::dom::bindings::structuredclone::StructuredCloneData;
|
||||
use crate::dom::serviceworkerglobalscope::{ServiceWorkerGlobalScope, ServiceWorkerScriptMsg};
|
||||
use crate::dom::serviceworkerregistration::longest_prefix_match;
|
||||
use crossbeam_channel::{unbounded, Receiver, RecvError, Sender};
|
||||
use devtools_traits::{DevtoolsPageInfo, ScriptToDevtoolsControlMsg};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use net_traits::{CoreResourceMsg, CustomResponseMediator};
|
||||
use script_traits::{DOMMessage, SWManagerMsg, SWManagerSenders, ScopeThings, ServiceWorkerMsg};
|
||||
use servo_channel::{channel, route_ipc_receiver_to_new_servo_receiver, Receiver, Sender};
|
||||
use servo_config::prefs::PREFS;
|
||||
use servo_url::ServoUrl;
|
||||
use std::collections::HashMap;
|
||||
|
@ -58,8 +59,8 @@ impl ServiceWorkerManager {
|
|||
let (own_sender, from_constellation_receiver) = ipc::channel().unwrap();
|
||||
let (resource_chan, resource_port) = ipc::channel().unwrap();
|
||||
let from_constellation =
|
||||
route_ipc_receiver_to_new_servo_receiver(from_constellation_receiver);
|
||||
let resource_port = route_ipc_receiver_to_new_servo_receiver(resource_port);
|
||||
ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(from_constellation_receiver);
|
||||
let resource_port = ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(resource_port);
|
||||
let _ = sw_senders
|
||||
.resource_sender
|
||||
.send(CoreResourceMsg::NetworkMediator(resource_chan));
|
||||
|
@ -90,7 +91,7 @@ impl ServiceWorkerManager {
|
|||
) -> Option<Sender<ServiceWorkerScriptMsg>> {
|
||||
let scope_things = self.registered_workers.get(&scope_url);
|
||||
if let Some(scope_things) = scope_things {
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
let (devtools_sender, devtools_receiver) = ipc::channel().unwrap();
|
||||
if let Some(ref chan) = scope_things.devtools_chan {
|
||||
let title = format!("ServiceWorker for {}", scope_things.script_url);
|
||||
|
@ -122,7 +123,7 @@ impl ServiceWorkerManager {
|
|||
}
|
||||
|
||||
fn handle_message(&mut self) {
|
||||
while let Some(message) = self.receive_message() {
|
||||
while let Ok(message) = self.receive_message() {
|
||||
let should_continue = match message {
|
||||
Message::FromConstellation(msg) => self.handle_message_from_constellation(msg),
|
||||
Message::FromResource(msg) => self.handle_message_from_resource(msg),
|
||||
|
@ -196,10 +197,10 @@ impl ServiceWorkerManager {
|
|||
true
|
||||
}
|
||||
|
||||
fn receive_message(&mut self) -> Option<Message> {
|
||||
fn receive_message(&mut self) -> Result<Message, RecvError> {
|
||||
select! {
|
||||
recv(self.own_port.select(), msg) => msg.map(Message::FromConstellation),
|
||||
recv(self.resource_receiver.select(), msg) => msg.map(Message::FromResource),
|
||||
recv(self.own_port) -> msg => msg.map(Message::FromConstellation),
|
||||
recv(self.resource_receiver) -> msg => msg.map(Message::FromResource),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ use crate::dom::worker::TrustedWorkerAddress;
|
|||
use crate::script_runtime::ScriptThreadEventCategory;
|
||||
use crate::task::TaskBox;
|
||||
use crate::task_source::TaskSourceName;
|
||||
use crossbeam_channel::{self, Receiver, Sender};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use servo_channel::{base_channel, Receiver, Sender};
|
||||
use std::cell::Cell;
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::default::Default;
|
||||
|
@ -63,7 +63,7 @@ impl<T: QueuedTaskConversion> TaskQueue<T> {
|
|||
if !first_msg.is_wake_up() {
|
||||
incoming.push(first_msg);
|
||||
}
|
||||
while let Some(msg) = self.port.try_recv() {
|
||||
while let Ok(msg) = self.port.try_recv() {
|
||||
if !msg.is_wake_up() {
|
||||
incoming.push(msg);
|
||||
}
|
||||
|
@ -110,21 +110,21 @@ impl<T: QueuedTaskConversion> TaskQueue<T> {
|
|||
|
||||
/// Reset the queue for a new iteration of the event-loop,
|
||||
/// returning the port about whose readiness we want to be notified.
|
||||
pub fn select(&self) -> &base_channel::Receiver<T> {
|
||||
pub fn select(&self) -> &crossbeam_channel::Receiver<T> {
|
||||
// This is a new iteration of the event-loop, so we reset the "business" counter.
|
||||
self.taken_task_counter.set(0);
|
||||
// We want to be notified when the script-port is ready to receive.
|
||||
// Hence that's the one we need to include in the select.
|
||||
self.port.select()
|
||||
&self.port
|
||||
}
|
||||
|
||||
/// Take a message from the front of the queue, without waiting if empty.
|
||||
pub fn recv(&self) -> Option<T> {
|
||||
self.msg_queue.borrow_mut().pop_front()
|
||||
pub fn recv(&self) -> Result<T, ()> {
|
||||
self.msg_queue.borrow_mut().pop_front().ok_or(())
|
||||
}
|
||||
|
||||
/// Same as recv.
|
||||
pub fn try_recv(&self) -> Option<T> {
|
||||
pub fn try_recv(&self) -> Result<T, ()> {
|
||||
self.recv()
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ use crate::script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
|
|||
use crate::script_thread::MainThreadScriptMsg;
|
||||
use crate::task::{TaskCanceller, TaskOnce};
|
||||
use crate::task_source::{TaskSource, TaskSourceName};
|
||||
use crossbeam_channel::Sender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use servo_channel::Sender;
|
||||
|
||||
#[derive(Clone, JSTraceable)]
|
||||
pub struct HistoryTraversalTaskSource(pub Sender<MainThreadScriptMsg>, pub PipelineId);
|
||||
|
|
|
@ -11,9 +11,9 @@ use crate::script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
|
|||
use crate::script_thread::MainThreadScriptMsg;
|
||||
use crate::task::{TaskCanceller, TaskOnce};
|
||||
use crate::task_source::{TaskSource, TaskSourceName};
|
||||
use crossbeam_channel::Sender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::Sender;
|
||||
use std::fmt;
|
||||
use std::result::Result;
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ use crate::script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
|
|||
use crate::script_thread::MainThreadScriptMsg;
|
||||
use crate::task::{TaskCanceller, TaskOnce};
|
||||
use crate::task_source::{TaskSource, TaskSourceName};
|
||||
use crossbeam_channel::Sender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::Sender;
|
||||
use std::fmt;
|
||||
use std::result::Result;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ app_units = "0.7"
|
|||
atomic_refcell = "0.1"
|
||||
canvas_traits = {path = "../canvas_traits"}
|
||||
cssparser = "0.25"
|
||||
crossbeam-channel = "0.3"
|
||||
euclid = "0.19"
|
||||
gfx_traits = {path = "../gfx_traits"}
|
||||
html5ever = "0.22"
|
||||
|
@ -33,7 +34,6 @@ script_traits = {path = "../script_traits"}
|
|||
selectors = { path = "../selectors" }
|
||||
servo_arc = {path = "../servo_arc"}
|
||||
servo_atoms = {path = "../atoms"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_url = {path = "../url"}
|
||||
style = {path = "../style", features = ["servo"]}
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
use app_units::Au;
|
||||
use crate::rpc::LayoutRPC;
|
||||
use crate::{OpaqueStyleAndLayoutData, PendingImage, TrustedNodeAddress};
|
||||
use crossbeam_channel::{Receiver, Sender};
|
||||
use euclid::{Point2D, Rect};
|
||||
use gfx_traits::Epoch;
|
||||
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
||||
|
@ -17,7 +18,6 @@ use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as Cons
|
|||
use script_traits::{ScrollState, UntrustedNodeAddress, WindowSizeData};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::{Receiver, Sender};
|
||||
use servo_url::ServoUrl;
|
||||
use std::sync::Arc;
|
||||
use style::context::QuirksMode;
|
||||
|
|
|
@ -14,6 +14,7 @@ path = "lib.rs"
|
|||
bluetooth_traits = {path = "../bluetooth_traits"}
|
||||
canvas_traits = {path = "../canvas_traits"}
|
||||
cookie = "0.11"
|
||||
crossbeam-channel = "0.3"
|
||||
devtools_traits = {path = "../devtools_traits"}
|
||||
embedder_traits = {path = "../embedder_traits"}
|
||||
euclid = "0.19"
|
||||
|
@ -31,7 +32,6 @@ net_traits = {path = "../net_traits"}
|
|||
profile_traits = {path = "../profile_traits"}
|
||||
serde = "1.0"
|
||||
servo_atoms = {path = "../atoms"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_url = {path = "../url"}
|
||||
style_traits = {path = "../style_traits", features = ["servo"]}
|
||||
time = "0.1.12"
|
||||
|
|
|
@ -22,6 +22,7 @@ pub mod webdriver_msg;
|
|||
use bluetooth_traits::BluetoothRequest;
|
||||
use canvas_traits::webgl::WebGLPipeline;
|
||||
use crate::webdriver_msg::{LoadStatus, WebDriverScriptCommand};
|
||||
use crossbeam_channel::{Receiver, RecvTimeoutError, Sender};
|
||||
use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId};
|
||||
use euclid::{Length, Point2D, Rect, TypedScale, TypedSize2D, Vector2D};
|
||||
use gfx_traits::Epoch;
|
||||
|
@ -42,7 +43,6 @@ use profile_traits::mem;
|
|||
use profile_traits::time as profile_time;
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::{Receiver, Sender};
|
||||
use servo_url::ImmutableOrigin;
|
||||
use servo_url::ServoUrl;
|
||||
use std::collections::HashMap;
|
||||
|
@ -828,6 +828,12 @@ pub enum PaintWorkletError {
|
|||
WorkletNotFound,
|
||||
}
|
||||
|
||||
impl From<RecvTimeoutError> for PaintWorkletError {
|
||||
fn from(_: RecvTimeoutError) -> PaintWorkletError {
|
||||
PaintWorkletError::Timeout
|
||||
}
|
||||
}
|
||||
|
||||
/// Execute paint code in the worklet thread pool.
|
||||
pub trait Painter: SpeculativePainter {
|
||||
/// <https://drafts.css-houdini.org/css-paint-api/#draw-a-paint-image>
|
||||
|
|
|
@ -40,7 +40,7 @@ canvas = {path = "../canvas"}
|
|||
canvas_traits = {path = "../canvas_traits"}
|
||||
compositing = {path = "../compositing", features = ["gleam"]}
|
||||
constellation = {path = "../constellation"}
|
||||
crossbeam-channel = "0.2"
|
||||
crossbeam-channel = "0.3"
|
||||
debugger = {path = "../debugger"}
|
||||
devtools = {path = "../devtools"}
|
||||
devtools_traits = {path = "../devtools_traits"}
|
||||
|
@ -60,7 +60,6 @@ profile_traits = {path = "../profile_traits"}
|
|||
script = {path = "../script"}
|
||||
script_layout_interface = {path = "../script_layout_interface"}
|
||||
script_traits = {path = "../script_traits"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_config = {path = "../config"}
|
||||
servo_geometry = {path = "../geometry"}
|
||||
servo_url = {path = "../url"}
|
||||
|
|
|
@ -42,7 +42,6 @@ pub use profile_traits;
|
|||
pub use script;
|
||||
pub use script_layout_interface;
|
||||
pub use script_traits;
|
||||
pub use servo_channel;
|
||||
pub use servo_config;
|
||||
pub use servo_geometry;
|
||||
pub use servo_url;
|
||||
|
@ -71,6 +70,7 @@ use compositing::{IOCompositor, RenderNotifier, ShutdownState};
|
|||
use constellation::content_process_sandbox_profile;
|
||||
use constellation::{Constellation, InitialConstellationState, UnprivilegedPipelineContent};
|
||||
use constellation::{FromCompositorLogger, FromScriptLogger};
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use embedder_traits::{EmbedderMsg, EmbedderProxy, EmbedderReceiver, EventLoopWaker};
|
||||
use env_logger::Builder as EnvLoggerBuilder;
|
||||
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
|
||||
|
@ -86,7 +86,6 @@ use profile::time as profile_time;
|
|||
use profile_traits::mem;
|
||||
use profile_traits::time;
|
||||
use script_traits::{ConstellationMsg, SWManagerSenders, ScriptToConstellationChan};
|
||||
use servo_channel::{channel, Sender};
|
||||
use servo_config::opts;
|
||||
use servo_config::prefs::PREFS;
|
||||
use std::borrow::Cow;
|
||||
|
@ -451,7 +450,7 @@ where
|
|||
fn create_embedder_channel(
|
||||
event_loop_waker: Box<dyn EventLoopWaker>,
|
||||
) -> (EmbedderProxy, EmbedderReceiver) {
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
(
|
||||
EmbedderProxy {
|
||||
sender: sender,
|
||||
|
@ -464,7 +463,7 @@ fn create_embedder_channel(
|
|||
fn create_compositor_channel(
|
||||
event_loop_waker: Box<dyn EventLoopWaker>,
|
||||
) -> (CompositorProxy, CompositorReceiver) {
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
(
|
||||
CompositorProxy {
|
||||
sender: sender,
|
||||
|
|
|
@ -21,7 +21,7 @@ gecko = ["num_cpus",
|
|||
use_bindgen = ["bindgen", "regex", "toml"]
|
||||
servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5ever",
|
||||
"cssparser/serde", "encoding_rs", "malloc_size_of/servo", "arrayvec/use_union",
|
||||
"servo_url", "string_cache", "servo_channel"]
|
||||
"servo_url", "string_cache", "crossbeam-channel"]
|
||||
gecko_debug = []
|
||||
|
||||
[dependencies]
|
||||
|
@ -32,6 +32,7 @@ bitflags = "1.0"
|
|||
byteorder = "1.0"
|
||||
cfg-if = "0.1.0"
|
||||
cssparser = "0.25"
|
||||
crossbeam-channel = { version = "0.3", optional = true }
|
||||
new_debug_unreachable = "1.0"
|
||||
encoding_rs = {version = "0.7", optional = true}
|
||||
euclid = "0.19"
|
||||
|
@ -59,7 +60,6 @@ selectors = { path = "../selectors" }
|
|||
serde = {version = "1.0", optional = true, features = ["derive"]}
|
||||
servo_arc = { path = "../servo_arc" }
|
||||
servo_atoms = {path = "../atoms", optional = true}
|
||||
servo_channel = {path = "../channel", optional = true}
|
||||
servo_config = {path = "../config", optional = true}
|
||||
smallbitvec = "2.1.1"
|
||||
smallvec = "0.6"
|
||||
|
|
|
@ -25,9 +25,8 @@ use crate::values::computed::TimingFunction;
|
|||
use crate::values::generics::box_::AnimationIterationCount;
|
||||
use crate::values::generics::easing::{StepPosition, TimingFunction as GenericTimingFunction};
|
||||
use crate::Atom;
|
||||
use crossbeam_channel::Sender;
|
||||
use servo_arc::Arc;
|
||||
#[cfg(feature = "servo")]
|
||||
use servo_channel::Sender;
|
||||
use std::fmt;
|
||||
#[cfg(feature = "gecko")]
|
||||
use std::sync::mpsc::Sender;
|
||||
|
|
|
@ -29,6 +29,8 @@ use crate::thread_state::{self, ThreadState};
|
|||
use crate::timer::Timer;
|
||||
use crate::traversal::DomTraversal;
|
||||
use crate::traversal_flags::TraversalFlags;
|
||||
#[cfg(feature = "servo")]
|
||||
use crossbeam_channel::Sender;
|
||||
use euclid::Size2D;
|
||||
use euclid::TypedScale;
|
||||
use fxhash::FxHashMap;
|
||||
|
@ -39,8 +41,6 @@ use selectors::NthIndexCache;
|
|||
use servo_arc::Arc;
|
||||
#[cfg(feature = "servo")]
|
||||
use servo_atoms::Atom;
|
||||
#[cfg(feature = "servo")]
|
||||
use servo_channel::Sender;
|
||||
use std::fmt;
|
||||
use std::ops;
|
||||
#[cfg(feature = "servo")]
|
||||
|
|
|
@ -36,6 +36,8 @@ extern crate byteorder;
|
|||
#[macro_use]
|
||||
#[no_link]
|
||||
extern crate cfg_if;
|
||||
#[cfg(feature = "servo")]
|
||||
extern crate crossbeam_channel;
|
||||
#[macro_use]
|
||||
extern crate cssparser;
|
||||
#[macro_use]
|
||||
|
@ -85,8 +87,6 @@ pub extern crate servo_arc;
|
|||
#[macro_use]
|
||||
extern crate servo_atoms;
|
||||
#[cfg(feature = "servo")]
|
||||
extern crate servo_channel;
|
||||
#[cfg(feature = "servo")]
|
||||
extern crate servo_config;
|
||||
#[cfg(feature = "servo")]
|
||||
extern crate servo_url;
|
||||
|
|
|
@ -13,6 +13,7 @@ path = "lib.rs"
|
|||
[dependencies]
|
||||
base64 = "0.9"
|
||||
cookie = "0.11"
|
||||
crossbeam-channel = "0.3"
|
||||
euclid = "0.19"
|
||||
hyper = "0.12"
|
||||
image = "0.20"
|
||||
|
@ -25,7 +26,6 @@ regex = "1.0"
|
|||
serde = "1"
|
||||
serde_json = "1"
|
||||
script_traits = {path = "../script_traits"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_config = {path = "../config"}
|
||||
servo_url = {path = "../url"}
|
||||
url = "1.2"
|
||||
|
|
|
@ -12,6 +12,7 @@ extern crate log;
|
|||
extern crate serde;
|
||||
|
||||
use base64;
|
||||
use crossbeam_channel::Sender;
|
||||
use euclid::TypedSize2D;
|
||||
use hyper::Method;
|
||||
use image::{DynamicImage, ImageFormat, RgbImage};
|
||||
|
@ -28,7 +29,6 @@ use script_traits::{ConstellationMsg, LoadData, WebDriverCommandMsg};
|
|||
use serde::de::{Deserialize, Deserializer, MapAccess, Visitor};
|
||||
use serde::ser::{Serialize, Serializer};
|
||||
use serde_json::{self, Value};
|
||||
use servo_channel::Sender;
|
||||
use servo_config::prefs::{PrefValue, PREFS};
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::ToOwned;
|
||||
|
|
|
@ -16,12 +16,12 @@ oculusvr = ['rust-webvr/oculusvr']
|
|||
|
||||
[dependencies]
|
||||
canvas_traits = {path = "../canvas_traits"}
|
||||
crossbeam-channel = "0.3"
|
||||
euclid = "0.19"
|
||||
ipc-channel = "0.11"
|
||||
log = "0.4"
|
||||
msg = {path = "../msg"}
|
||||
rust-webvr = {version = "0.9", features = ["openvr"]}
|
||||
script_traits = {path = "../script_traits"}
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_config = {path = "../config"}
|
||||
webvr_traits = {path = "../webvr_traits" }
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use canvas_traits::webgl;
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use euclid::Size2D;
|
||||
use ipc_channel::ipc;
|
||||
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use rust_webvr::VRServiceManager;
|
||||
use script_traits::ConstellationMsg;
|
||||
use servo_channel::{channel, Receiver, Sender};
|
||||
use servo_config::prefs::PREFS;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::{thread, time};
|
||||
|
@ -71,7 +71,7 @@ impl WebVRThread {
|
|||
vr_compositor_chan: WebVRCompositorSender,
|
||||
) -> (IpcSender<WebVRMsg>, Sender<Sender<ConstellationMsg>>) {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
let (constellation_sender, constellation_receiver) = channel();
|
||||
let (constellation_sender, constellation_receiver) = unbounded();
|
||||
let sender_clone = sender.clone();
|
||||
thread::Builder::new()
|
||||
.name("WebVRThread".into())
|
||||
|
@ -361,7 +361,7 @@ pub type WebVRCompositorSender = Sender<Option<WebVRCompositor>>;
|
|||
|
||||
impl WebVRCompositorHandler {
|
||||
pub fn new() -> (Box<WebVRCompositorHandler>, WebVRCompositorSender) {
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
let instance = Box::new(WebVRCompositorHandler {
|
||||
compositors: HashMap::new(),
|
||||
webvr_thread_receiver: receiver,
|
||||
|
|
|
@ -41,7 +41,7 @@ js_backtrace = ["libservo/js_backtrace"]
|
|||
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||
backtrace = "0.3"
|
||||
bitflags = "1.0"
|
||||
crossbeam-channel = "0.2"
|
||||
crossbeam-channel = "0.3"
|
||||
euclid = "0.19"
|
||||
gleam = "0.6"
|
||||
glutin = "0.19"
|
||||
|
|
|
@ -253,7 +253,6 @@ class MachCommands(CommandBase):
|
|||
"selectors",
|
||||
"servo_config",
|
||||
"servo_remutex",
|
||||
"servo_channel",
|
||||
]
|
||||
if not packages:
|
||||
packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit"))) - set(['.DS_Store'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue