mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Removed util.
This commit is contained in:
parent
01b6ad55bd
commit
9be4fd56ce
133 changed files with 396 additions and 352 deletions
131
Cargo.lock
generated
131
Cargo.lock
generated
|
@ -14,9 +14,9 @@ dependencies = [
|
||||||
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"script_traits 0.0.1",
|
"script_traits 0.0.1",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webdriver 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"webdriver 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
@ -185,7 +185,6 @@ dependencies = [
|
||||||
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tinyfiledialogs 0.1.0 (git+https://github.com/jdm/tinyfiledialogs)",
|
"tinyfiledialogs 0.1.0 (git+https://github.com/jdm/tinyfiledialogs)",
|
||||||
"util 0.0.1",
|
|
||||||
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -197,7 +196,7 @@ dependencies = [
|
||||||
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
"servo_config 0.0.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -265,7 +264,7 @@ dependencies = [
|
||||||
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"offscreen_gl_context 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"offscreen_gl_context 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"plugins 0.0.1",
|
"plugins 0.0.1",
|
||||||
"util 0.0.1",
|
"servo_config 0.0.1",
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -398,10 +397,11 @@ dependencies = [
|
||||||
"script_traits 0.0.1",
|
"script_traits 0.0.1",
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"servo_config 0.0.1",
|
||||||
|
"servo_geometry 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"webrender 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
@ -433,9 +433,10 @@ dependencies = [
|
||||||
"script_traits 0.0.1",
|
"script_traits 0.0.1",
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"servo_config 0.0.1",
|
||||||
|
"servo_remutex 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"util 0.0.1",
|
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -544,7 +545,6 @@ name = "debugger"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"ws 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ws 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -582,7 +582,6 @@ dependencies = [
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -657,9 +656,10 @@ dependencies = [
|
||||||
"objc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"objc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"plugins 0.0.1",
|
"plugins 0.0.1",
|
||||||
"script_traits 0.0.1",
|
"script_traits 0.0.1",
|
||||||
|
"servo_config 0.0.1",
|
||||||
|
"servo_geometry 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"util 0.0.1",
|
|
||||||
"x11 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"x11 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -941,6 +941,7 @@ dependencies = [
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo-fontconfig 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"servo-fontconfig 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo_atoms 0.0.1",
|
"servo_atoms 0.0.1",
|
||||||
|
"servo_geometry 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"simd 0.1.1 (git+https://github.com/huonw/simd)",
|
"simd 0.1.1 (git+https://github.com/huonw/simd)",
|
||||||
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -948,7 +949,6 @@ dependencies = [
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
"xi-unicode 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xi-unicode 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
@ -1026,10 +1026,11 @@ dependencies = [
|
||||||
"script_traits 0.0.1",
|
"script_traits 0.0.1",
|
||||||
"servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo-glutin 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"servo-glutin 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"servo_config 0.0.1",
|
||||||
|
"servo_geometry 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"x11 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"x11 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
@ -1322,13 +1323,13 @@ dependencies = [
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo_atoms 0.0.1",
|
"servo_atoms 0.0.1",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"style 0.0.1",
|
"style 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1367,9 +1368,10 @@ dependencies = [
|
||||||
"selectors 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"selectors 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"servo_config 0.0.1",
|
||||||
|
"servo_geometry 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style 0.0.1",
|
"style 0.0.1",
|
||||||
"util 0.0.1",
|
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1489,11 +1491,11 @@ dependencies = [
|
||||||
"script 0.0.1",
|
"script 0.0.1",
|
||||||
"script_layout_interface 0.0.1",
|
"script_layout_interface 0.0.1",
|
||||||
"script_traits 0.0.1",
|
"script_traits 0.0.1",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"sig 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"sig 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"style 0.0.1",
|
"style 0.0.1",
|
||||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"webdriver_server 0.0.1",
|
"webdriver_server 0.0.1",
|
||||||
"webrender 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
|
@ -1676,13 +1678,13 @@ dependencies = [
|
||||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"threadpool 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"threadpool 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tinyfiledialogs 0.1.0 (git+https://github.com/jdm/tinyfiledialogs)",
|
"tinyfiledialogs 0.1.0 (git+https://github.com/jdm/tinyfiledialogs)",
|
||||||
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
"websocket 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"websocket 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1716,11 +1718,11 @@ dependencies = [
|
||||||
"net_traits 0.0.1",
|
"net_traits 0.0.1",
|
||||||
"plugins 0.0.1",
|
"plugins 0.0.1",
|
||||||
"profile_traits 0.0.1",
|
"profile_traits 0.0.1",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1741,9 +1743,9 @@ dependencies = [
|
||||||
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
"websocket 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"websocket 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2088,9 +2090,9 @@ dependencies = [
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"task_info 0.0.1",
|
"task_info 0.0.1",
|
||||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2113,9 +2115,9 @@ dependencies = [
|
||||||
"plugins 0.0.1",
|
"plugins 0.0.1",
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"signpost 0.1.0 (git+https://github.com/pcwalton/signpost.git)",
|
"signpost 0.1.0 (git+https://github.com/pcwalton/signpost.git)",
|
||||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2292,6 +2294,8 @@ dependencies = [
|
||||||
"selectors 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"selectors 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo_atoms 0.0.1",
|
"servo_atoms 0.0.1",
|
||||||
|
"servo_config 0.0.1",
|
||||||
|
"servo_geometry 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"style 0.0.1",
|
"style 0.0.1",
|
||||||
|
@ -2299,7 +2303,6 @@ dependencies = [
|
||||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tinyfiledialogs 0.1.0 (git+https://github.com/jdm/tinyfiledialogs)",
|
"tinyfiledialogs 0.1.0 (git+https://github.com/jdm/tinyfiledialogs)",
|
||||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.11.0 (git+https://github.com/servo/webrender)",
|
||||||
"websocket 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"websocket 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2464,9 +2467,10 @@ dependencies = [
|
||||||
"plugin_compiletest 0.0.1",
|
"plugin_compiletest 0.0.1",
|
||||||
"profile_tests 0.0.1",
|
"profile_tests 0.0.1",
|
||||||
"script_tests 0.0.1",
|
"script_tests 0.0.1",
|
||||||
|
"servo_config_tests 0.0.1",
|
||||||
|
"servo_remutex_tests 0.0.1",
|
||||||
"sig 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"sig 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"style_tests 0.0.1",
|
"style_tests 0.0.1",
|
||||||
"util_tests 0.0.1",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2562,6 +2566,58 @@ dependencies = [
|
||||||
"string_cache_codegen 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"string_cache_codegen 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "servo_config"
|
||||||
|
version = "0.0.1"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"env_logger 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"plugins 0.0.1",
|
||||||
|
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"servo_geometry 0.0.1",
|
||||||
|
"servo_url 0.0.1",
|
||||||
|
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "servo_config_tests"
|
||||||
|
version = "0.0.1"
|
||||||
|
dependencies = [
|
||||||
|
"servo_config 0.0.1",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "servo_geometry"
|
||||||
|
version = "0.0.1"
|
||||||
|
dependencies = [
|
||||||
|
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "servo_remutex"
|
||||||
|
version = "0.0.1"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "servo_remutex_tests"
|
||||||
|
version = "0.0.1"
|
||||||
|
dependencies = [
|
||||||
|
"servo_remutex 0.0.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "servo_url"
|
name = "servo_url"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
|
@ -2695,12 +2751,12 @@ dependencies = [
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo_atoms 0.0.1",
|
"servo_atoms 0.0.1",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicode-segmentation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-segmentation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"util 0.0.1",
|
|
||||||
"walkdir 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"walkdir 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2718,10 +2774,10 @@ dependencies = [
|
||||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"selectors 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"selectors 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo_atoms 0.0.1",
|
"servo_atoms 0.0.1",
|
||||||
|
"servo_config 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style 0.0.1",
|
"style 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"util 0.0.1",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3018,35 +3074,6 @@ name = "utf8-ranges"
|
||||||
version = "0.1.3"
|
version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "util"
|
|
||||||
version = "0.0.1"
|
|
||||||
dependencies = [
|
|
||||||
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"env_logger 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"plugins 0.0.1",
|
|
||||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"serde 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"serde_derive 0.8.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"servo_url 0.0.1",
|
|
||||||
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "util_tests"
|
|
||||||
version = "0.0.1"
|
|
||||||
dependencies = [
|
|
||||||
"util 0.0.1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
|
|
|
@ -15,7 +15,6 @@ bluetooth_traits = {path = "../bluetooth_traits"}
|
||||||
device = {git = "https://github.com/servo/devices", features = ["bluetooth-test"]}
|
device = {git = "https://github.com/servo/devices", features = ["bluetooth-test"]}
|
||||||
ipc-channel = "0.5"
|
ipc-channel = "0.5"
|
||||||
rand = "0.3"
|
rand = "0.3"
|
||||||
util = {path = "../util"}
|
|
||||||
uuid = {version = "0.3.1", features = ["v4"]}
|
uuid = {version = "0.3.1", features = ["v4"]}
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
|
|
|
@ -10,7 +10,6 @@ extern crate ipc_channel;
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
extern crate tinyfiledialogs;
|
extern crate tinyfiledialogs;
|
||||||
extern crate util;
|
|
||||||
extern crate uuid;
|
extern crate uuid;
|
||||||
|
|
||||||
pub mod test;
|
pub mod test;
|
||||||
|
@ -29,7 +28,6 @@ use std::collections::{HashMap, HashSet};
|
||||||
use std::string::String;
|
use std::string::String;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use util::thread::spawn_named;
|
|
||||||
|
|
||||||
// A transaction not completed within 30 seconds shall time out. Such a transaction shall be considered to have failed.
|
// A transaction not completed within 30 seconds shall time out. Such a transaction shall be considered to have failed.
|
||||||
// https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439 (Vol. 3, page 480)
|
// https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439 (Vol. 3, page 480)
|
||||||
|
@ -88,9 +86,9 @@ impl BluetoothThreadFactory for IpcSender<BluetoothRequest> {
|
||||||
fn new() -> IpcSender<BluetoothRequest> {
|
fn new() -> IpcSender<BluetoothRequest> {
|
||||||
let (sender, receiver) = ipc::channel().unwrap();
|
let (sender, receiver) = ipc::channel().unwrap();
|
||||||
let adapter = BluetoothAdapter::init().ok();
|
let adapter = BluetoothAdapter::init().ok();
|
||||||
spawn_named("BluetoothThread".to_owned(), move || {
|
thread::Builder::new().name("BluetoothThread".to_owned()).spawn(move || {
|
||||||
BluetoothManager::new(receiver, adapter).start();
|
BluetoothManager::new(receiver, adapter).start();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
sender
|
sender
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,4 +14,4 @@ ipc-channel = "0.5"
|
||||||
regex = "0.1.43"
|
regex = "0.1.43"
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
util = {path = "../util"}
|
servo_config = {path = "../config"}
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
use servo_config::resource_files::read_resource_file;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
use std::string::String;
|
use std::string::String;
|
||||||
use util::resource_files::read_resource_file;
|
|
||||||
|
|
||||||
const BLOCKLIST_FILE: &'static str = "gatt_blocklist.txt";
|
const BLOCKLIST_FILE: &'static str = "gatt_blocklist.txt";
|
||||||
const BLOCKLIST_FILE_NOT_FOUND: &'static str = "Could not find gatt_blocklist.txt file";
|
const BLOCKLIST_FILE_NOT_FOUND: &'static str = "Could not find gatt_blocklist.txt file";
|
||||||
|
|
|
@ -8,7 +8,7 @@ extern crate ipc_channel;
|
||||||
extern crate regex;
|
extern crate regex;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
extern crate util;
|
extern crate servo_config;
|
||||||
|
|
||||||
pub mod blocklist;
|
pub mod blocklist;
|
||||||
pub mod scanfilter;
|
pub mod scanfilter;
|
||||||
|
|
|
@ -19,7 +19,7 @@ log = "0.3.5"
|
||||||
num-traits = "0.1.32"
|
num-traits = "0.1.32"
|
||||||
offscreen_gl_context = "0.5.0"
|
offscreen_gl_context = "0.5.0"
|
||||||
plugins = {path = "../plugins"}
|
plugins = {path = "../plugins"}
|
||||||
util = {path = "../util"}
|
servo_config = {path = "../config"}
|
||||||
|
|
||||||
[dependencies.webrender_traits]
|
[dependencies.webrender_traits]
|
||||||
git = "https://github.com/servo/webrender"
|
git = "https://github.com/servo/webrender"
|
||||||
|
|
|
@ -15,7 +15,7 @@ use ipc_channel::ipc::{self, IpcSender};
|
||||||
use num_traits::ToPrimitive;
|
use num_traits::ToPrimitive;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use util::thread::spawn_named;
|
use std::thread;
|
||||||
use webrender_traits;
|
use webrender_traits;
|
||||||
|
|
||||||
impl<'a> CanvasPaintThread<'a> {
|
impl<'a> CanvasPaintThread<'a> {
|
||||||
|
@ -121,7 +121,7 @@ impl<'a> CanvasPaintThread<'a> {
|
||||||
antialias: bool)
|
antialias: bool)
|
||||||
-> IpcSender<CanvasMsg> {
|
-> IpcSender<CanvasMsg> {
|
||||||
let (sender, receiver) = ipc::channel::<CanvasMsg>().unwrap();
|
let (sender, receiver) = ipc::channel::<CanvasMsg>().unwrap();
|
||||||
spawn_named("CanvasThread".to_owned(), move || {
|
thread::Builder::new().name("CanvasThread".to_owned()).spawn(move || {
|
||||||
let mut painter = CanvasPaintThread::new(size, webrender_api_sender, antialias);
|
let mut painter = CanvasPaintThread::new(size, webrender_api_sender, antialias);
|
||||||
loop {
|
loop {
|
||||||
let msg = receiver.recv();
|
let msg = receiver.recv();
|
||||||
|
@ -211,7 +211,7 @@ impl<'a> CanvasPaintThread<'a> {
|
||||||
CanvasMsg::WebGL(_) => panic!("Wrong message sent to Canvas2D thread"),
|
CanvasMsg::WebGL(_) => panic!("Wrong message sent to Canvas2D thread"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
sender
|
sender
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ extern crate ipc_channel;
|
||||||
extern crate log;
|
extern crate log;
|
||||||
extern crate num_traits;
|
extern crate num_traits;
|
||||||
extern crate offscreen_gl_context;
|
extern crate offscreen_gl_context;
|
||||||
extern crate util;
|
extern crate servo_config;
|
||||||
extern crate webrender_traits;
|
extern crate webrender_traits;
|
||||||
|
|
||||||
pub mod canvas_paint_thread;
|
pub mod canvas_paint_thread;
|
||||||
|
|
|
@ -9,10 +9,10 @@ use gleam::gl;
|
||||||
use ipc_channel::ipc::{self, IpcSender};
|
use ipc_channel::ipc::{self, IpcSender};
|
||||||
use offscreen_gl_context::{ColorAttachmentType, GLContext, GLLimits};
|
use offscreen_gl_context::{ColorAttachmentType, GLContext, GLLimits};
|
||||||
use offscreen_gl_context::{GLContextAttributes, NativeGLContext, OSMesaContext};
|
use offscreen_gl_context::{GLContextAttributes, NativeGLContext, OSMesaContext};
|
||||||
|
use servo_config::opts;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
use util::opts;
|
use std::thread;
|
||||||
use util::thread::spawn_named;
|
|
||||||
use webrender_traits;
|
use webrender_traits;
|
||||||
|
|
||||||
enum GLContextWrapper {
|
enum GLContextWrapper {
|
||||||
|
@ -151,7 +151,7 @@ impl WebGLPaintThread {
|
||||||
-> Result<(IpcSender<CanvasMsg>, GLLimits), String> {
|
-> Result<(IpcSender<CanvasMsg>, GLLimits), String> {
|
||||||
let (sender, receiver) = ipc::channel::<CanvasMsg>().unwrap();
|
let (sender, receiver) = ipc::channel::<CanvasMsg>().unwrap();
|
||||||
let (result_chan, result_port) = channel();
|
let (result_chan, result_port) = channel();
|
||||||
spawn_named("WebGLThread".to_owned(), move || {
|
thread::Builder::new().name("WebGLThread".to_owned()).spawn(move || {
|
||||||
let mut painter = match WebGLPaintThread::new(size, attrs, webrender_api_sender) {
|
let mut painter = match WebGLPaintThread::new(size, attrs, webrender_api_sender) {
|
||||||
Ok((thread, limits)) => {
|
Ok((thread, limits)) => {
|
||||||
result_chan.send(Ok(limits)).unwrap();
|
result_chan.send(Ok(limits)).unwrap();
|
||||||
|
@ -191,7 +191,7 @@ impl WebGLPaintThread {
|
||||||
CanvasMsg::Canvas2d(_) => panic!("Wrong message sent to WebGLThread"),
|
CanvasMsg::Canvas2d(_) => panic!("Wrong message sent to WebGLThread"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
result_port.recv().unwrap().map(|limits| (sender, limits))
|
result_port.recv().unwrap().map(|limits| (sender, limits))
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,11 @@ profile_traits = {path = "../profile_traits"}
|
||||||
script_traits = {path = "../script_traits"}
|
script_traits = {path = "../script_traits"}
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
|
servo_config = {path = "../config", features = ["servo"]}
|
||||||
|
servo_geometry = {path = "../geometry", features = ["servo"]}
|
||||||
servo_url = {path = "../url", features = ["servo"]}
|
servo_url = {path = "../url", features = ["servo"]}
|
||||||
style_traits = {path = "../style_traits"}
|
style_traits = {path = "../style_traits"}
|
||||||
time = "0.1.17"
|
time = "0.1.17"
|
||||||
util = {path = "../util"}
|
|
||||||
|
|
||||||
[dependencies.webrender]
|
[dependencies.webrender]
|
||||||
git = "https://github.com/servo/webrender"
|
git = "https://github.com/servo/webrender"
|
||||||
|
|
|
@ -26,6 +26,9 @@ use script_traits::{ConstellationMsg, LayoutControlMsg, LoadData, MouseButton};
|
||||||
use script_traits::{MouseEventType, StackingContextScrollState};
|
use script_traits::{MouseEventType, StackingContextScrollState};
|
||||||
use script_traits::{TouchpadPressurePhase, TouchEventType, TouchId, WindowSizeData, WindowSizeType};
|
use script_traits::{TouchpadPressurePhase, TouchEventType, TouchId, WindowSizeData, WindowSizeType};
|
||||||
use script_traits::CompositorEvent::{self, MouseMoveEvent, MouseButtonEvent, TouchEvent, TouchpadPressureEvent};
|
use script_traits::CompositorEvent::{self, MouseMoveEvent, MouseButtonEvent, TouchEvent, TouchpadPressureEvent};
|
||||||
|
use servo_config::opts;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
|
use servo_geometry::ScreenPx;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
@ -36,9 +39,6 @@ use style_traits::{PagePx, ViewportPx};
|
||||||
use style_traits::viewport::ViewportConstraints;
|
use style_traits::viewport::ViewportConstraints;
|
||||||
use time::{precise_time_ns, precise_time_s};
|
use time::{precise_time_ns, precise_time_s};
|
||||||
use touch::{TouchHandler, TouchAction};
|
use touch::{TouchHandler, TouchAction};
|
||||||
use util::geometry::ScreenPx;
|
|
||||||
use util::opts;
|
|
||||||
use util::prefs::PREFS;
|
|
||||||
use webrender;
|
use webrender;
|
||||||
use webrender_traits::{self, ScrollEventPhase, ServoScrollRootId};
|
use webrender_traits::{self, ScrollEventPhase, ServoScrollRootId};
|
||||||
use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg};
|
use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg};
|
||||||
|
|
|
@ -23,11 +23,11 @@ extern crate profile_traits;
|
||||||
extern crate script_traits;
|
extern crate script_traits;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
extern crate servo_config;
|
||||||
|
extern crate servo_geometry;
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
extern crate style_traits;
|
extern crate style_traits;
|
||||||
extern crate time;
|
extern crate time;
|
||||||
#[macro_use]
|
|
||||||
extern crate util;
|
|
||||||
extern crate webrender;
|
extern crate webrender;
|
||||||
extern crate webrender_traits;
|
extern crate webrender_traits;
|
||||||
|
|
||||||
|
|
|
@ -13,10 +13,10 @@ use gfx_traits::DevicePixel;
|
||||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
||||||
use net_traits::net_error_list::NetError;
|
use net_traits::net_error_list::NetError;
|
||||||
use script_traits::{MouseButton, TouchEventType, TouchId, TouchpadPressurePhase};
|
use script_traits::{MouseButton, TouchEventType, TouchId, TouchpadPressurePhase};
|
||||||
|
use servo_geometry::ScreenPx;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::fmt::{Debug, Error, Formatter};
|
use std::fmt::{Debug, Error, Formatter};
|
||||||
use style_traits::cursor::Cursor;
|
use style_traits::cursor::Cursor;
|
||||||
use util::geometry::ScreenPx;
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub enum MouseWindowEvent {
|
pub enum MouseWindowEvent {
|
||||||
|
|
|
@ -1,31 +1,29 @@
|
||||||
[package]
|
[package]
|
||||||
name = "util"
|
name = "servo_config"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
authors = ["The Servo Project Developers"]
|
authors = ["The Servo Project Developers"]
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "util"
|
name = "servo_config"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# servo as opposed to geckolib
|
# servo as opposed to geckolib
|
||||||
servo = ["serde", "serde_derive", "app_units/plugins",
|
servo = ["serde", "serde_derive", "url/heap_size", "url/serde", "plugins"]
|
||||||
"euclid/unstable", "url/heap_size", "url/serde", "plugins"]
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
app_units = "0.3"
|
|
||||||
bitflags = "0.7"
|
bitflags = "0.7"
|
||||||
euclid = "0.10.1"
|
euclid = "0.10.1"
|
||||||
getopts = "0.2.11"
|
getopts = "0.2.11"
|
||||||
heapsize = "0.3.0"
|
|
||||||
lazy_static = "0.2"
|
lazy_static = "0.2"
|
||||||
log = "0.3.5"
|
log = "0.3.5"
|
||||||
num_cpus = "1.1.0"
|
num_cpus = "1.1.0"
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
serde = {version = "0.8", optional = true}
|
serde = {version = "0.8", optional = true}
|
||||||
serde_derive = {version = "0.8", optional = true}
|
serde_derive = {version = "0.8", optional = true}
|
||||||
|
servo_geometry = {path = "../geometry"}
|
||||||
servo_url = {path = "../url"}
|
servo_url = {path = "../url"}
|
||||||
plugins = {path = "../plugins", optional = true}
|
plugins = {path = "../plugins", optional = true}
|
||||||
url = "1.2"
|
url = "1.2"
|
|
@ -2,37 +2,32 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#![cfg_attr(feature = "servo", feature(nonzero))]
|
|
||||||
#![cfg_attr(feature = "servo", feature(plugin))]
|
#![cfg_attr(feature = "servo", feature(plugin))]
|
||||||
#![cfg_attr(feature = "servo", feature(proc_macro))]
|
#![cfg_attr(feature = "servo", feature(proc_macro))]
|
||||||
#![cfg_attr(feature = "servo", plugin(plugins))]
|
#![cfg_attr(feature = "servo", plugin(plugins))]
|
||||||
|
|
||||||
#![deny(unsafe_code)]
|
#![deny(unsafe_code)]
|
||||||
|
|
||||||
extern crate app_units;
|
|
||||||
#[allow(unused_extern_crates)] #[macro_use] extern crate bitflags;
|
#[allow(unused_extern_crates)] #[macro_use] extern crate bitflags;
|
||||||
extern crate core;
|
extern crate core;
|
||||||
#[macro_use] extern crate euclid;
|
extern crate euclid;
|
||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
#[macro_use] extern crate heapsize;
|
|
||||||
#[allow(unused_extern_crates)] #[macro_use] extern crate lazy_static;
|
#[allow(unused_extern_crates)] #[macro_use] extern crate lazy_static;
|
||||||
#[macro_use] extern crate log;
|
#[macro_use] extern crate log;
|
||||||
extern crate num_cpus;
|
extern crate num_cpus;
|
||||||
extern crate rustc_serialize;
|
extern crate rustc_serialize;
|
||||||
#[cfg(feature = "servo")] extern crate serde;
|
#[cfg(feature = "servo")] extern crate serde;
|
||||||
#[cfg(feature = "servo")] #[macro_use] extern crate serde_derive;
|
#[cfg(feature = "servo")] #[macro_use] extern crate serde_derive;
|
||||||
|
extern crate servo_geometry;
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
extern crate url;
|
extern crate url;
|
||||||
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
|
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
|
||||||
extern crate xdg;
|
extern crate xdg;
|
||||||
|
|
||||||
pub mod basedir;
|
pub mod basedir;
|
||||||
pub mod geometry;
|
|
||||||
#[allow(unsafe_code)] pub mod opts;
|
#[allow(unsafe_code)] pub mod opts;
|
||||||
pub mod prefs;
|
pub mod prefs;
|
||||||
#[cfg(feature = "servo")] pub mod remutex;
|
|
||||||
pub mod resource_files;
|
pub mod resource_files;
|
||||||
pub mod thread;
|
|
||||||
|
|
||||||
pub fn servo_version() -> String {
|
pub fn servo_version() -> String {
|
||||||
let cargo_version = env!("CARGO_PKG_VERSION");
|
let cargo_version = env!("CARGO_PKG_VERSION");
|
||||||
|
@ -42,13 +37,3 @@ pub fn servo_version() -> String {
|
||||||
None => format!("Servo {}", cargo_version),
|
None => format!("Servo {}", cargo_version),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clamp<T: Ord>(lo: T, mid: T, hi: T) -> T {
|
|
||||||
if mid < lo {
|
|
||||||
lo
|
|
||||||
} else if mid > hi {
|
|
||||||
hi
|
|
||||||
} else {
|
|
||||||
mid
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,11 +6,11 @@
|
||||||
//! from command line arguments.
|
//! from command line arguments.
|
||||||
|
|
||||||
use euclid::size::TypedSize2D;
|
use euclid::size::TypedSize2D;
|
||||||
use geometry::ScreenPx;
|
|
||||||
use getopts::Options;
|
use getopts::Options;
|
||||||
use num_cpus;
|
use num_cpus;
|
||||||
use prefs::{self, PrefValue, PREFS};
|
use prefs::{self, PrefValue, PREFS};
|
||||||
use resource_files::set_resources_path;
|
use resource_files::set_resources_path;
|
||||||
|
use servo_geometry::ScreenPx;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::cmp;
|
use std::cmp;
|
|
@ -33,8 +33,9 @@ script_traits = {path = "../script_traits"}
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
style_traits = {path = "../style_traits"}
|
style_traits = {path = "../style_traits"}
|
||||||
|
servo_config = {path = "../config", features = ["servo"]}
|
||||||
|
servo_remutex = {path = "../remutex"}
|
||||||
servo_url = {path = "../url", features = ["servo"]}
|
servo_url = {path = "../url", features = ["servo"]}
|
||||||
util = {path = "../util"}
|
|
||||||
|
|
||||||
[dependencies.webrender_traits]
|
[dependencies.webrender_traits]
|
||||||
git = "https://github.com/servo/webrender"
|
git = "https://github.com/servo/webrender"
|
||||||
|
|
|
@ -47,6 +47,9 @@ use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, Scri
|
||||||
use script_traits::{LogEntry, ServiceWorkerMsg, webdriver_msg};
|
use script_traits::{LogEntry, ServiceWorkerMsg, webdriver_msg};
|
||||||
use script_traits::{MozBrowserErrorType, MozBrowserEvent, WebDriverCommandMsg, WindowSizeData};
|
use script_traits::{MozBrowserErrorType, MozBrowserEvent, WebDriverCommandMsg, WindowSizeData};
|
||||||
use script_traits::{SWManagerMsg, ScopeThings, WindowSizeType};
|
use script_traits::{SWManagerMsg, ScopeThings, WindowSizeType};
|
||||||
|
use servo_config::opts;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
|
use servo_remutex::ReentrantMutex;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::collections::{HashMap, VecDeque};
|
use std::collections::{HashMap, VecDeque};
|
||||||
|
@ -64,10 +67,6 @@ use style_traits::PagePx;
|
||||||
use style_traits::cursor::Cursor;
|
use style_traits::cursor::Cursor;
|
||||||
use style_traits::viewport::ViewportConstraints;
|
use style_traits::viewport::ViewportConstraints;
|
||||||
use timer_scheduler::TimerScheduler;
|
use timer_scheduler::TimerScheduler;
|
||||||
use util::opts;
|
|
||||||
use util::prefs::PREFS;
|
|
||||||
use util::remutex::ReentrantMutex;
|
|
||||||
use util::thread::spawn_named;
|
|
||||||
use webrender_traits;
|
use webrender_traits;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
|
@ -505,7 +504,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
||||||
let (swmanager_sender, swmanager_receiver) = ipc::channel().expect("ipc channel failure");
|
let (swmanager_sender, swmanager_receiver) = ipc::channel().expect("ipc channel failure");
|
||||||
let sw_mgr_clone = swmanager_sender.clone();
|
let sw_mgr_clone = swmanager_sender.clone();
|
||||||
|
|
||||||
spawn_named("Constellation".to_owned(), move || {
|
thread::Builder::new().name("Constellation".to_owned()).spawn(move || {
|
||||||
let (ipc_script_sender, ipc_script_receiver) = ipc::channel().expect("ipc channel failure");
|
let (ipc_script_sender, ipc_script_receiver) = ipc::channel().expect("ipc channel failure");
|
||||||
let script_receiver = ROUTER.route_ipc_receiver_to_new_mpsc_receiver(ipc_script_receiver);
|
let script_receiver = ROUTER.route_ipc_receiver_to_new_mpsc_receiver(ipc_script_receiver);
|
||||||
|
|
||||||
|
@ -568,7 +567,8 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
||||||
};
|
};
|
||||||
|
|
||||||
constellation.run();
|
constellation.run();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
(compositor_sender, swmanager_sender)
|
(compositor_sender, swmanager_sender)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,10 +36,10 @@ extern crate script_traits;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
extern crate servo_config;
|
||||||
|
extern crate servo_remutex;
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
extern crate style_traits;
|
extern crate style_traits;
|
||||||
#[macro_use]
|
|
||||||
extern crate util;
|
|
||||||
extern crate webrender_traits;
|
extern crate webrender_traits;
|
||||||
|
|
||||||
mod constellation;
|
mod constellation;
|
||||||
|
|
|
@ -24,6 +24,8 @@ use script_traits::{ConstellationControlMsg, InitialScriptState};
|
||||||
use script_traits::{LayoutControlMsg, LayoutMsg, LoadData, MozBrowserEvent};
|
use script_traits::{LayoutControlMsg, LayoutMsg, LoadData, MozBrowserEvent};
|
||||||
use script_traits::{NewLayoutInfo, SWManagerMsg, SWManagerSenders, ScriptMsg};
|
use script_traits::{NewLayoutInfo, SWManagerMsg, SWManagerSenders, ScriptMsg};
|
||||||
use script_traits::{ScriptThreadFactory, TimerEventRequest, WindowSizeData};
|
use script_traits::{ScriptThreadFactory, TimerEventRequest, WindowSizeData};
|
||||||
|
use servo_config::opts::{self, Opts};
|
||||||
|
use servo_config::prefs::{PREFS, Pref};
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
@ -33,8 +35,6 @@ use std::process;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::mpsc::Sender;
|
use std::sync::mpsc::Sender;
|
||||||
use style_traits::{PagePx, ViewportPx};
|
use style_traits::{PagePx, ViewportPx};
|
||||||
use util::opts::{self, Opts};
|
|
||||||
use util::prefs::{PREFS, Pref};
|
|
||||||
use webrender_traits;
|
use webrender_traits;
|
||||||
|
|
||||||
/// A uniquely-identifiable pipeline of script thread, layout thread, and paint thread.
|
/// A uniquely-identifiable pipeline of script thread, layout thread, and paint thread.
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use gaol::profile::{Operation, PathPattern, Profile};
|
use gaol::profile::{Operation, PathPattern, Profile};
|
||||||
|
use servo_config::resource_files;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use util::resource_files;
|
|
||||||
|
|
||||||
/// Our content process sandbox profile on Mac. As restrictive as possible.
|
/// Our content process sandbox profile on Mac. As restrictive as possible.
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
|
|
@ -12,7 +12,6 @@ crate_type = ["rlib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.3.5"
|
log = "0.3.5"
|
||||||
util = {path = "../util"}
|
|
||||||
|
|
||||||
[target.'cfg(not(target_os = "android"))'.dependencies]
|
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||||
ws = "0.5.3"
|
ws = "0.5.3"
|
||||||
|
|
|
@ -4,13 +4,12 @@
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
extern crate util;
|
|
||||||
#[cfg(not(target_os = "android"))]
|
#[cfg(not(target_os = "android"))]
|
||||||
extern crate ws;
|
extern crate ws;
|
||||||
|
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
use util::thread::spawn_named;
|
use std::thread;
|
||||||
#[cfg(not(target_os = "android"))]
|
#[cfg(not(target_os = "android"))]
|
||||||
use ws::{Builder, CloseCode, Handler, Handshake};
|
use ws::{Builder, CloseCode, Handler, Handshake};
|
||||||
|
|
||||||
|
@ -45,14 +44,14 @@ impl Handler for Connection {
|
||||||
pub fn start_server(port: u16) -> Sender {
|
pub fn start_server(port: u16) -> Sender {
|
||||||
debug!("Starting server.");
|
debug!("Starting server.");
|
||||||
let (sender, receiver) = channel();
|
let (sender, receiver) = channel();
|
||||||
spawn_named("debugger".to_owned(), move || {
|
thread::Builder::new().name("debugger".to_owned()).spawn(move || {
|
||||||
let socket = Builder::new().build(|sender: ws::Sender| {
|
let socket = Builder::new().build(|sender: ws::Sender| {
|
||||||
Connection { sender: sender }
|
Connection { sender: sender }
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
let sender = socket.broadcaster();
|
let sender = socket.broadcaster();
|
||||||
spawn_named("debugger-websocket".to_owned(), move || {
|
thread::Builder::new().name("debugger-websocket".to_owned()).spawn(move || {
|
||||||
socket.listen(("127.0.0.1", port)).unwrap();
|
socket.listen(("127.0.0.1", port)).unwrap();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
while let Ok(message) = receiver.recv() {
|
while let Ok(message) = receiver.recv() {
|
||||||
match message {
|
match message {
|
||||||
Message::ShutdownServer => {
|
Message::ShutdownServer => {
|
||||||
|
@ -61,7 +60,7 @@ pub fn start_server(port: u16) -> Sender {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sender.shutdown().unwrap();
|
sender.shutdown().unwrap();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
Sender(sender)
|
Sender(sender)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,4 +22,3 @@ serde = "0.8"
|
||||||
serde_json = "0.8"
|
serde_json = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
time = "0.1"
|
time = "0.1"
|
||||||
util = {path = "../util"}
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ use std::net::TcpStream;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use util::thread::spawn_named;
|
|
||||||
|
|
||||||
pub struct TimelineActor {
|
pub struct TimelineActor {
|
||||||
name: String,
|
name: String,
|
||||||
|
@ -150,7 +149,7 @@ impl TimelineActor {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
spawn_named("PullTimelineMarkers".to_owned(), move || {
|
thread::Builder::new().name("PullTimelineMarkers".to_owned()).spawn(move || {
|
||||||
loop {
|
loop {
|
||||||
if !*is_recording.lock().unwrap() {
|
if !*is_recording.lock().unwrap() {
|
||||||
break;
|
break;
|
||||||
|
@ -164,7 +163,7 @@ impl TimelineActor {
|
||||||
|
|
||||||
thread::sleep(Duration::from_millis(DEFAULT_TIMELINE_DATA_PULL_TIMEOUT));
|
thread::sleep(Duration::from_millis(DEFAULT_TIMELINE_DATA_PULL_TIMEOUT));
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ extern crate serde;
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate time;
|
extern crate time;
|
||||||
extern crate util;
|
|
||||||
|
|
||||||
use actor::{Actor, ActorRegistry};
|
use actor::{Actor, ActorRegistry};
|
||||||
use actors::console::ConsoleActor;
|
use actors::console::ConsoleActor;
|
||||||
|
@ -57,8 +56,8 @@ use std::collections::hash_map::Entry::{Occupied, Vacant};
|
||||||
use std::net::{Shutdown, TcpListener, TcpStream};
|
use std::net::{Shutdown, TcpListener, TcpStream};
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::sync::mpsc::{Receiver, Sender, channel};
|
use std::sync::mpsc::{Receiver, Sender, channel};
|
||||||
|
use std::thread;
|
||||||
use time::precise_time_ns;
|
use time::precise_time_ns;
|
||||||
use util::thread::spawn_named;
|
|
||||||
|
|
||||||
mod actor;
|
mod actor;
|
||||||
/// Corresponds to http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/
|
/// Corresponds to http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/
|
||||||
|
@ -137,9 +136,9 @@ pub fn start_server(port: u16) -> Sender<DevtoolsControlMsg> {
|
||||||
let (sender, receiver) = channel();
|
let (sender, receiver) = channel();
|
||||||
{
|
{
|
||||||
let sender = sender.clone();
|
let sender = sender.clone();
|
||||||
spawn_named("Devtools".to_owned(), move || {
|
thread::Builder::new().name("Devtools".to_owned()).spawn(move || {
|
||||||
run_server(sender, receiver, port)
|
run_server(sender, receiver, port)
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
sender
|
sender
|
||||||
}
|
}
|
||||||
|
@ -485,23 +484,23 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
|
||||||
}
|
}
|
||||||
|
|
||||||
let sender_clone = sender.clone();
|
let sender_clone = sender.clone();
|
||||||
spawn_named("DevtoolsClientAcceptor".to_owned(), move || {
|
thread::Builder::new().name("DevtoolsClientAcceptor".to_owned()).spawn(move || {
|
||||||
// accept connections and process them, spawning a new thread for each one
|
// accept connections and process them, spawning a new thread for each one
|
||||||
for stream in listener.incoming() {
|
for stream in listener.incoming() {
|
||||||
// connection succeeded
|
// connection succeeded
|
||||||
sender_clone.send(DevtoolsControlMsg::FromChrome(
|
sender_clone.send(DevtoolsControlMsg::FromChrome(
|
||||||
ChromeToDevtoolsControlMsg::AddClient(stream.unwrap()))).unwrap();
|
ChromeToDevtoolsControlMsg::AddClient(stream.unwrap()))).unwrap();
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
while let Ok(msg) = receiver.recv() {
|
while let Ok(msg) = receiver.recv() {
|
||||||
match msg {
|
match msg {
|
||||||
DevtoolsControlMsg::FromChrome(ChromeToDevtoolsControlMsg::AddClient(stream)) => {
|
DevtoolsControlMsg::FromChrome(ChromeToDevtoolsControlMsg::AddClient(stream)) => {
|
||||||
let actors = actors.clone();
|
let actors = actors.clone();
|
||||||
accepted_connections.push(stream.try_clone().unwrap());
|
accepted_connections.push(stream.try_clone().unwrap());
|
||||||
spawn_named("DevtoolsClientHandler".to_owned(), move || {
|
thread::Builder::new().name("DevtoolsClientHandler".to_owned()).spawn(move || {
|
||||||
handle_client(actors, stream.try_clone().unwrap())
|
handle_client(actors, stream.try_clone().unwrap())
|
||||||
})
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
DevtoolsControlMsg::FromScript(ScriptToDevtoolsControlMsg::FramerateTick(
|
DevtoolsControlMsg::FromScript(ScriptToDevtoolsControlMsg::FramerateTick(
|
||||||
actor_name, tick)) =>
|
actor_name, tick)) =>
|
||||||
|
|
19
components/geometry/Cargo.toml
Normal file
19
components/geometry/Cargo.toml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
[package]
|
||||||
|
name = "servo_geometry"
|
||||||
|
version = "0.0.1"
|
||||||
|
authors = ["The Servo Project Developers"]
|
||||||
|
license = "MPL-2.0"
|
||||||
|
publish = false
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "servo_geometry"
|
||||||
|
path = "lib.rs"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
# servo as opposed to geckolib
|
||||||
|
servo = ["app_units/plugins", "euclid/unstable"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
app_units = "0.3"
|
||||||
|
euclid = "0.10.1"
|
||||||
|
heapsize = "0.3.0"
|
|
@ -2,6 +2,10 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
extern crate app_units;
|
||||||
|
#[macro_use] extern crate euclid;
|
||||||
|
#[macro_use] extern crate heapsize;
|
||||||
|
|
||||||
use app_units::{Au, MAX_AU};
|
use app_units::{Au, MAX_AU};
|
||||||
use euclid::point::Point2D;
|
use euclid::point::Point2D;
|
||||||
use euclid::rect::Rect;
|
use euclid::rect::Rect;
|
|
@ -32,6 +32,7 @@ range = {path = "../range"}
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
servo_atoms = {path = "../atoms"}
|
servo_atoms = {path = "../atoms"}
|
||||||
|
servo_geometry = {path = "../geometry"}
|
||||||
servo_url = {path = "../url"}
|
servo_url = {path = "../url"}
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
smallvec = "0.1"
|
smallvec = "0.1"
|
||||||
|
@ -39,7 +40,6 @@ style = {path = "../style"}
|
||||||
style_traits = {path = "../style_traits"}
|
style_traits = {path = "../style_traits"}
|
||||||
time = "0.1.12"
|
time = "0.1.12"
|
||||||
unicode-script = {version = "0.1", features = ["harfbuzz"]}
|
unicode-script = {version = "0.1", features = ["harfbuzz"]}
|
||||||
util = {path = "../util"}
|
|
||||||
xi-unicode = "0.0.1"
|
xi-unicode = "0.0.1"
|
||||||
|
|
||||||
[dependencies.webrender_traits]
|
[dependencies.webrender_traits]
|
||||||
|
|
|
@ -25,6 +25,7 @@ use ipc_channel::ipc::IpcSharedMemory;
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use net_traits::image::base::{Image, PixelFormat};
|
use net_traits::image::base::{Image, PixelFormat};
|
||||||
use range::Range;
|
use range::Range;
|
||||||
|
use servo_geometry::{au_rect_to_f32_rect, f32_rect_to_au_rect, max_rect};
|
||||||
use std::cmp::{self, Ordering};
|
use std::cmp::{self, Ordering};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -33,7 +34,6 @@ use style::computed_values::{border_style, filter, image_rendering, mix_blend_mo
|
||||||
use style_traits::cursor::Cursor;
|
use style_traits::cursor::Cursor;
|
||||||
use text::TextRun;
|
use text::TextRun;
|
||||||
use text::glyph::ByteIndex;
|
use text::glyph::ByteIndex;
|
||||||
use util::geometry::{self, max_rect};
|
|
||||||
use webrender_traits::{self, ColorF, GradientStop, WebGLContextId};
|
use webrender_traits::{self, ColorF, GradientStop, WebGLContextId};
|
||||||
|
|
||||||
pub use style::dom::OpaqueNode;
|
pub use style::dom::OpaqueNode;
|
||||||
|
@ -397,9 +397,9 @@ impl StackingContext {
|
||||||
.pre_mul(&self.transform);
|
.pre_mul(&self.transform);
|
||||||
let transform_2d = transform.to_2d();
|
let transform_2d = transform.to_2d();
|
||||||
|
|
||||||
let overflow = geometry::au_rect_to_f32_rect(self.overflow);
|
let overflow = au_rect_to_f32_rect(self.overflow);
|
||||||
let overflow = transform_2d.transform_rect(&overflow);
|
let overflow = transform_2d.transform_rect(&overflow);
|
||||||
geometry::f32_rect_to_au_rect(overflow)
|
f32_rect_to_au_rect(overflow)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_with_tree(&self, print_tree: &mut PrintTree) {
|
pub fn print_with_tree(&self, print_tree: &mut PrintTree) {
|
||||||
|
|
|
@ -21,10 +21,10 @@ use std::collections::HashMap;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
use std::thread;
|
||||||
use std::u32;
|
use std::u32;
|
||||||
use style::font_face::{EffectiveSources, Source};
|
use style::font_face::{EffectiveSources, Source};
|
||||||
use style::properties::longhands::font_family::computed_value::FontFamily;
|
use style::properties::longhands::font_family::computed_value::FontFamily;
|
||||||
use util::thread::spawn_named;
|
|
||||||
use webrender_traits;
|
use webrender_traits;
|
||||||
|
|
||||||
/// A list of font templates that make up a given font family.
|
/// A list of font templates that make up a given font family.
|
||||||
|
@ -396,7 +396,7 @@ impl FontCacheThread {
|
||||||
let (chan, port) = ipc::channel().unwrap();
|
let (chan, port) = ipc::channel().unwrap();
|
||||||
|
|
||||||
let channel_to_self = chan.clone();
|
let channel_to_self = chan.clone();
|
||||||
spawn_named("FontCacheThread".to_owned(), move || {
|
thread::Builder::new().name("FontCacheThread".to_owned()).spawn(move || {
|
||||||
// TODO: Allow users to specify these.
|
// TODO: Allow users to specify these.
|
||||||
let generic_fonts = populate_generic_fonts();
|
let generic_fonts = populate_generic_fonts();
|
||||||
|
|
||||||
|
@ -414,7 +414,7 @@ impl FontCacheThread {
|
||||||
|
|
||||||
cache.refresh_local_families();
|
cache.refresh_local_families();
|
||||||
cache.run();
|
cache.run();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
FontCacheThread {
|
FontCacheThread {
|
||||||
chan: chan,
|
chan: chan,
|
||||||
|
|
|
@ -63,6 +63,7 @@ extern crate rustc_serialize;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
extern crate servo_geometry;
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
#[macro_use] extern crate servo_atoms;
|
#[macro_use] extern crate servo_atoms;
|
||||||
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
|
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
|
||||||
|
@ -72,7 +73,6 @@ extern crate style;
|
||||||
extern crate style_traits;
|
extern crate style_traits;
|
||||||
extern crate time;
|
extern crate time;
|
||||||
extern crate unicode_script;
|
extern crate unicode_script;
|
||||||
extern crate util;
|
|
||||||
extern crate webrender_traits;
|
extern crate webrender_traits;
|
||||||
extern crate xi_unicode;
|
extern crate xi_unicode;
|
||||||
|
|
||||||
|
|
|
@ -39,13 +39,13 @@ serde = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
serde_json = "0.8"
|
serde_json = "0.8"
|
||||||
servo_atoms = {path = "../atoms"}
|
servo_atoms = {path = "../atoms"}
|
||||||
|
servo_config = {path = "../config"}
|
||||||
servo_url = {path = "../url"}
|
servo_url = {path = "../url"}
|
||||||
smallvec = "0.1"
|
smallvec = "0.1"
|
||||||
style = {path = "../style"}
|
style = {path = "../style"}
|
||||||
style_traits = {path = "../style_traits"}
|
style_traits = {path = "../style_traits"}
|
||||||
unicode-bidi = "0.2"
|
unicode-bidi = "0.2"
|
||||||
unicode-script = {version = "0.1", features = ["harfbuzz"]}
|
unicode-script = {version = "0.1", features = ["harfbuzz"]}
|
||||||
util = {path = "../util"}
|
|
||||||
|
|
||||||
[dependencies.webrender_traits]
|
[dependencies.webrender_traits]
|
||||||
git = "https://github.com/servo/webrender"
|
git = "https://github.com/servo/webrender"
|
||||||
|
|
|
@ -61,7 +61,6 @@ use style::properties::ServoComputedValues;
|
||||||
use style::servo::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, REPOSITION};
|
use style::servo::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, REPOSITION};
|
||||||
use style::values::computed::{LengthOrPercentageOrNone, LengthOrPercentage};
|
use style::values::computed::{LengthOrPercentageOrNone, LengthOrPercentage};
|
||||||
use style::values::computed::LengthOrPercentageOrAuto;
|
use style::values::computed::LengthOrPercentageOrAuto;
|
||||||
use util::clamp;
|
|
||||||
|
|
||||||
/// Information specific to floated blocks.
|
/// Information specific to floated blocks.
|
||||||
#[derive(Clone, Serialize)]
|
#[derive(Clone, Serialize)]
|
||||||
|
@ -1534,7 +1533,7 @@ impl BlockFlow {
|
||||||
size + self.fragment.border_padding.inline_start_end(),
|
size + self.fragment.border_padding.inline_start_end(),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
clamp(min_inline_size, available_inline_size, max_inline_size)
|
max(min_inline_size, min(available_inline_size, max_inline_size))
|
||||||
};
|
};
|
||||||
self.base.position.size.inline = inline_size + self.fragment.margin.inline_start_end();
|
self.base.position.size.inline = inline_size + self.fragment.margin.inline_start_end();
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ use multicol::{MulticolColumnFlow, MulticolFlow};
|
||||||
use parallel;
|
use parallel;
|
||||||
use script_layout_interface::{LayoutElementType, LayoutNodeType, is_image_data};
|
use script_layout_interface::{LayoutElementType, LayoutNodeType, is_image_data};
|
||||||
use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||||
|
use servo_config::opts;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::collections::LinkedList;
|
use std::collections::LinkedList;
|
||||||
|
@ -64,7 +65,6 @@ use table_rowgroup::TableRowGroupFlow;
|
||||||
use table_wrapper::TableWrapperFlow;
|
use table_wrapper::TableWrapperFlow;
|
||||||
use text::TextRunScanner;
|
use text::TextRunScanner;
|
||||||
use traversal::PostorderNodeMutTraversal;
|
use traversal::PostorderNodeMutTraversal;
|
||||||
use util::opts;
|
|
||||||
use wrapper::{LayoutNodeLayoutData, TextContent, ThreadSafeLayoutNodeHelpers};
|
use wrapper::{LayoutNodeLayoutData, TextContent, ThreadSafeLayoutNodeHelpers};
|
||||||
|
|
||||||
/// The results of flow construction for a DOM node.
|
/// The results of flow construction for a DOM node.
|
||||||
|
|
|
@ -17,6 +17,7 @@ use net_traits::image::base::Image;
|
||||||
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread, ImageResponse, ImageState};
|
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread, ImageResponse, ImageState};
|
||||||
use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder};
|
use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder};
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
|
use servo_config::opts;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::borrow::Borrow;
|
use std::borrow::Borrow;
|
||||||
use std::cell::{RefCell, RefMut};
|
use std::cell::{RefCell, RefMut};
|
||||||
|
@ -25,7 +26,6 @@ use std::hash::BuildHasherDefault;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use style::context::{LocalStyleContext, StyleContext, SharedStyleContext};
|
use style::context::{LocalStyleContext, StyleContext, SharedStyleContext};
|
||||||
use util::opts;
|
|
||||||
|
|
||||||
struct LocalLayoutContext {
|
struct LocalLayoutContext {
|
||||||
style_context: LocalStyleContext,
|
style_context: LocalStyleContext,
|
||||||
|
|
|
@ -35,6 +35,7 @@ use model::{self, MaybeAuto, ToGfxMatrix};
|
||||||
use net_traits::image::base::PixelFormat;
|
use net_traits::image::base::PixelFormat;
|
||||||
use net_traits::image_cache_thread::UsePlaceholder;
|
use net_traits::image_cache_thread::UsePlaceholder;
|
||||||
use range::Range;
|
use range::Range;
|
||||||
|
use servo_config::opts;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::{cmp, f32};
|
use std::{cmp, f32};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
@ -57,7 +58,6 @@ use style::values::computed::{Gradient, GradientKind, LengthOrPercentage, Length
|
||||||
use style::values::specified::{AngleOrCorner, HorizontalDirection, VerticalDirection};
|
use style::values::specified::{AngleOrCorner, HorizontalDirection, VerticalDirection};
|
||||||
use style_traits::cursor::Cursor;
|
use style_traits::cursor::Cursor;
|
||||||
use table_cell::CollapsedBordersForCell;
|
use table_cell::CollapsedBordersForCell;
|
||||||
use util::opts;
|
|
||||||
use webrender_traits::{ColorF, GradientStop};
|
use webrender_traits::{ColorF, GradientStop};
|
||||||
|
|
||||||
trait RgbColor {
|
trait RgbColor {
|
||||||
|
|
|
@ -49,13 +49,13 @@ extern crate serde;
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
#[macro_use] extern crate servo_atoms;
|
#[macro_use] extern crate servo_atoms;
|
||||||
|
extern crate servo_config;
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
extern crate smallvec;
|
extern crate smallvec;
|
||||||
extern crate style;
|
extern crate style;
|
||||||
extern crate style_traits;
|
extern crate style_traits;
|
||||||
extern crate unicode_bidi;
|
extern crate unicode_bidi;
|
||||||
extern crate unicode_script;
|
extern crate unicode_script;
|
||||||
extern crate util;
|
|
||||||
extern crate webrender_traits;
|
extern crate webrender_traits;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -13,13 +13,13 @@ use flow::{self, Flow, MutableFlowUtils, PostorderFlowTraversal, PreorderFlowTra
|
||||||
use flow_ref::FlowRef;
|
use flow_ref::FlowRef;
|
||||||
use profile_traits::time::{self, TimerMetadata, profile};
|
use profile_traits::time::{self, TimerMetadata, profile};
|
||||||
use rayon;
|
use rayon;
|
||||||
|
use servo_config::opts;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::sync::atomic::{AtomicIsize, Ordering};
|
use std::sync::atomic::{AtomicIsize, Ordering};
|
||||||
use style::dom::UnsafeNode;
|
use style::dom::UnsafeNode;
|
||||||
use style::parallel::CHUNK_SIZE;
|
use style::parallel::CHUNK_SIZE;
|
||||||
use traversal::{AssignISizes, BubbleISizes};
|
use traversal::{AssignISizes, BubbleISizes};
|
||||||
use traversal::AssignBSizes;
|
use traversal::AssignBSizes;
|
||||||
use util::opts;
|
|
||||||
|
|
||||||
pub use style::parallel::traverse_dom;
|
pub use style::parallel::traverse_dom;
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,10 @@ use flow::IS_ABSOLUTELY_POSITIONED;
|
||||||
use fragment::FragmentBorderBoxIterator;
|
use fragment::FragmentBorderBoxIterator;
|
||||||
use generated_content::ResolveGeneratedContent;
|
use generated_content::ResolveGeneratedContent;
|
||||||
use gfx_traits::ScrollRootId;
|
use gfx_traits::ScrollRootId;
|
||||||
|
use servo_config::opts;
|
||||||
use style::context::StyleContext;
|
use style::context::StyleContext;
|
||||||
use style::servo::restyle_damage::{REFLOW, STORE_OVERFLOW};
|
use style::servo::restyle_damage::{REFLOW, STORE_OVERFLOW};
|
||||||
use traversal::{AssignBSizes, AssignISizes, BubbleISizes, BuildDisplayList};
|
use traversal::{AssignBSizes, AssignISizes, BubbleISizes, BuildDisplayList};
|
||||||
use util::opts;
|
|
||||||
|
|
||||||
pub use style::sequential::traverse_dom;
|
pub use style::sequential::traverse_dom;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ use flow::{self, PreorderFlowTraversal};
|
||||||
use flow::{CAN_BE_FRAGMENTED, Flow, ImmutableFlowUtils, PostorderFlowTraversal};
|
use flow::{CAN_BE_FRAGMENTED, Flow, ImmutableFlowUtils, PostorderFlowTraversal};
|
||||||
use gfx::display_list::OpaqueNode;
|
use gfx::display_list::OpaqueNode;
|
||||||
use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
||||||
|
use servo_config::opts;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use style::atomic_refcell::AtomicRefCell;
|
use style::atomic_refcell::AtomicRefCell;
|
||||||
use style::context::{LocalStyleContext, SharedStyleContext, StyleContext};
|
use style::context::{LocalStyleContext, SharedStyleContext, StyleContext};
|
||||||
|
@ -20,7 +21,6 @@ use style::selector_parser::RestyleDamage;
|
||||||
use style::servo::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, REPAINT};
|
use style::servo::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, REPAINT};
|
||||||
use style::traversal::{DomTraversalContext, recalc_style_at, remove_from_bloom_filter};
|
use style::traversal::{DomTraversalContext, recalc_style_at, remove_from_bloom_filter};
|
||||||
use style::traversal::PerLevelTraversalData;
|
use style::traversal::PerLevelTraversalData;
|
||||||
use util::opts;
|
|
||||||
use wrapper::{GetRawData, LayoutNodeHelpers, LayoutNodeLayoutData};
|
use wrapper::{GetRawData, LayoutNodeHelpers, LayoutNodeLayoutData};
|
||||||
|
|
||||||
pub struct RecalcStyleAndConstructFlows<'lc> {
|
pub struct RecalcStyleAndConstructFlows<'lc> {
|
||||||
|
|
|
@ -34,9 +34,10 @@ script_traits = {path = "../script_traits"}
|
||||||
selectors = "0.15"
|
selectors = "0.15"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
serde_json = "0.8"
|
serde_json = "0.8"
|
||||||
|
servo_config = {path = "../config"}
|
||||||
|
servo_geometry = {path = "../geometry"}
|
||||||
servo_url = {path = "../url"}
|
servo_url = {path = "../url"}
|
||||||
style = {path = "../style"}
|
style = {path = "../style"}
|
||||||
util = {path = "../util"}
|
|
||||||
|
|
||||||
[dependencies.webrender_traits]
|
[dependencies.webrender_traits]
|
||||||
git = "https://github.com/servo/webrender"
|
git = "https://github.com/servo/webrender"
|
||||||
|
|
|
@ -40,9 +40,10 @@ extern crate script_layout_interface;
|
||||||
extern crate script_traits;
|
extern crate script_traits;
|
||||||
extern crate selectors;
|
extern crate selectors;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
|
extern crate servo_config;
|
||||||
|
extern crate servo_geometry;
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
extern crate style;
|
extern crate style;
|
||||||
extern crate util;
|
|
||||||
extern crate webrender_traits;
|
extern crate webrender_traits;
|
||||||
|
|
||||||
use app_units::Au;
|
use app_units::Au;
|
||||||
|
@ -94,6 +95,10 @@ use script_layout_interface::wrapper_traits::LayoutNode;
|
||||||
use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg};
|
use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg};
|
||||||
use script_traits::{StackingContextScrollState, UntrustedNodeAddress};
|
use script_traits::{StackingContextScrollState, UntrustedNodeAddress};
|
||||||
use selectors::Element;
|
use selectors::Element;
|
||||||
|
use servo_config::opts;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
|
use servo_config::resource_files::read_resource_file;
|
||||||
|
use servo_geometry::max_rect;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
@ -103,6 +108,7 @@ use std::process;
|
||||||
use std::sync::{Arc, Mutex, MutexGuard};
|
use std::sync::{Arc, Mutex, MutexGuard};
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
use std::sync::mpsc::{Receiver, Sender, channel};
|
use std::sync::mpsc::{Receiver, Sender, channel};
|
||||||
|
use std::thread;
|
||||||
use style::animation::Animation;
|
use style::animation::Animation;
|
||||||
use style::context::{LocalStyleContextCreationInfo, ReflowGoal, SharedStyleContext};
|
use style::context::{LocalStyleContextCreationInfo, ReflowGoal, SharedStyleContext};
|
||||||
use style::data::StoredRestyleHint;
|
use style::data::StoredRestyleHint;
|
||||||
|
@ -117,11 +123,6 @@ use style::stylist::Stylist;
|
||||||
use style::thread_state;
|
use style::thread_state;
|
||||||
use style::timer::Timer;
|
use style::timer::Timer;
|
||||||
use style::traversal::DomTraversalContext;
|
use style::traversal::DomTraversalContext;
|
||||||
use util::geometry::max_rect;
|
|
||||||
use util::opts;
|
|
||||||
use util::prefs::PREFS;
|
|
||||||
use util::resource_files::read_resource_file;
|
|
||||||
use util::thread;
|
|
||||||
|
|
||||||
/// Information needed by the layout thread.
|
/// Information needed by the layout thread.
|
||||||
pub struct LayoutThread {
|
pub struct LayoutThread {
|
||||||
|
@ -229,7 +230,7 @@ pub struct LayoutThread {
|
||||||
/// only be a test-mode timer during testing for animations.
|
/// only be a test-mode timer during testing for animations.
|
||||||
timer: Timer,
|
timer: Timer,
|
||||||
|
|
||||||
// Number of layout threads. This is copied from `util::opts`, but we'd
|
// Number of layout threads. This is copied from `servo_config::opts`, but we'd
|
||||||
// rather limit the dependency on that module here.
|
// rather limit the dependency on that module here.
|
||||||
layout_threads: usize,
|
layout_threads: usize,
|
||||||
}
|
}
|
||||||
|
@ -253,8 +254,7 @@ impl LayoutThreadFactory for LayoutThread {
|
||||||
content_process_shutdown_chan: Option<IpcSender<()>>,
|
content_process_shutdown_chan: Option<IpcSender<()>>,
|
||||||
webrender_api_sender: webrender_traits::RenderApiSender,
|
webrender_api_sender: webrender_traits::RenderApiSender,
|
||||||
layout_threads: usize) {
|
layout_threads: usize) {
|
||||||
thread::spawn_named(format!("LayoutThread {:?}", id),
|
thread::Builder::new().name(format!("LayoutThread {:?}", id)).spawn(move || {
|
||||||
move || {
|
|
||||||
thread_state::initialize(thread_state::LAYOUT);
|
thread_state::initialize(thread_state::LAYOUT);
|
||||||
|
|
||||||
if let Some(top_level_frame_id) = top_level_frame_id {
|
if let Some(top_level_frame_id) = top_level_frame_id {
|
||||||
|
@ -285,7 +285,7 @@ impl LayoutThreadFactory for LayoutThread {
|
||||||
if let Some(content_process_shutdown_chan) = content_process_shutdown_chan {
|
if let Some(content_process_shutdown_chan) = content_process_shutdown_chan {
|
||||||
let _ = content_process_shutdown_chan.send(());
|
let _ = content_process_shutdown_chan.send(());
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,12 @@ profile_traits = {path = "../profile_traits"}
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
|
servo_config = {path = "../config"}
|
||||||
servo_url = {path = "../url"}
|
servo_url = {path = "../url"}
|
||||||
threadpool = "1.0"
|
threadpool = "1.0"
|
||||||
time = "0.1.17"
|
time = "0.1.17"
|
||||||
unicase = "1.4.0"
|
unicase = "1.4.0"
|
||||||
url = {version = "1.2", features = ["heap_size", "rustc-serialize"]}
|
url = {version = "1.2", features = ["heap_size", "rustc-serialize"]}
|
||||||
util = {path = "../util"}
|
|
||||||
uuid = {version = "0.3.1", features = ["v4"]}
|
uuid = {version = "0.3.1", features = ["v4"]}
|
||||||
websocket = "0.17"
|
websocket = "0.17"
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
use servo_config::resource_files::resources_dir_path;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::fs::canonicalize;
|
use std::fs::canonicalize;
|
||||||
use url::percent_encoding::percent_decode;
|
use url::percent_encoding::percent_decode;
|
||||||
use util::resource_files::resources_dir_path;
|
|
||||||
|
|
||||||
pub fn resolve_chrome_url(url: &ServoUrl) -> Result<ServoUrl, ()> {
|
pub fn resolve_chrome_url(url: &ServoUrl) -> Result<ServoUrl, ()> {
|
||||||
assert_eq!(url.scheme(), "chrome");
|
assert_eq!(url.scheme(), "chrome");
|
||||||
|
|
|
@ -6,8 +6,8 @@ use hyper::client::Pool;
|
||||||
use hyper::net::{HttpStream, HttpsConnector, SslClient};
|
use hyper::net::{HttpStream, HttpsConnector, SslClient};
|
||||||
use openssl::ssl::{SSL_OP_NO_COMPRESSION, SSL_OP_NO_SSLV2, SSL_OP_NO_SSLV3, SSL_VERIFY_PEER};
|
use openssl::ssl::{SSL_OP_NO_COMPRESSION, SSL_OP_NO_SSLV2, SSL_OP_NO_SSLV3, SSL_VERIFY_PEER};
|
||||||
use openssl::ssl::{Ssl, SslContext, SslMethod, SslStream};
|
use openssl::ssl::{Ssl, SslContext, SslMethod, SslStream};
|
||||||
|
use servo_config::resource_files::resources_dir_path;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use util::resource_files::resources_dir_path;
|
|
||||||
|
|
||||||
pub type Connector = HttpsConnector<ServoSslClient>;
|
pub type Connector = HttpsConnector<ServoSslClient>;
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use content_blocker_parser::{RuleList, parse_list};
|
use content_blocker_parser::{RuleList, parse_list};
|
||||||
|
use servo_config::resource_files::read_resource_file;
|
||||||
use std::str;
|
use std::str;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use util::resource_files::read_resource_file;
|
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref BLOCKED_CONTENT_RULES: Arc<Option<RuleList>> = Arc::new(create_rule_list());
|
pub static ref BLOCKED_CONTENT_RULES: Arc<Option<RuleList>> = Arc::new(create_rule_list());
|
||||||
|
|
|
@ -7,6 +7,7 @@ use mime_guess::guess_mime_type_opt;
|
||||||
use net_traits::blob_url_store::{BlobBuf, BlobURLStoreError};
|
use net_traits::blob_url_store::{BlobBuf, BlobURLStoreError};
|
||||||
use net_traits::filemanager_thread::{FileManagerResult, FileManagerThreadMsg, FileOrigin, FilterPattern};
|
use net_traits::filemanager_thread::{FileManagerResult, FileManagerThreadMsg, FileOrigin, FilterPattern};
|
||||||
use net_traits::filemanager_thread::{FileManagerThreadError, ReadFileProgress, RelativePos, SelectedFile};
|
use net_traits::filemanager_thread::{FileManagerThreadError, ReadFileProgress, RelativePos, SelectedFile};
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::{Read, Seek, SeekFrom};
|
use std::io::{Read, Seek, SeekFrom};
|
||||||
|
@ -14,11 +15,10 @@ use std::ops::Index;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
use std::sync::atomic::{self, AtomicBool, AtomicUsize, Ordering};
|
use std::sync::atomic::{self, AtomicBool, AtomicUsize, Ordering};
|
||||||
|
use std::thread;
|
||||||
#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
|
#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
|
||||||
use tinyfiledialogs;
|
use tinyfiledialogs;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use util::prefs::PREFS;
|
|
||||||
use util::thread::spawn_named;
|
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
/// The provider of file-dialog UI should implement this trait.
|
/// The provider of file-dialog UI should implement this trait.
|
||||||
|
@ -129,12 +129,12 @@ impl FileManager {
|
||||||
check_url_validity: bool,
|
check_url_validity: bool,
|
||||||
origin: FileOrigin) {
|
origin: FileOrigin) {
|
||||||
let store = self.store.clone();
|
let store = self.store.clone();
|
||||||
spawn_named("read file".to_owned(), move || {
|
thread::Builder::new().name("read file".to_owned()).spawn(move || {
|
||||||
if let Err(e) = store.try_read_file(&sender, id, check_url_validity,
|
if let Err(e) = store.try_read_file(&sender, id, check_url_validity,
|
||||||
origin) {
|
origin) {
|
||||||
let _ = sender.send(Err(FileManagerThreadError::BlobURLStoreError(e)));
|
let _ = sender.send(Err(FileManagerThreadError::BlobURLStoreError(e)));
|
||||||
}
|
}
|
||||||
})
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn promote_memory(&self,
|
pub fn promote_memory(&self,
|
||||||
|
@ -143,9 +143,9 @@ impl FileManager {
|
||||||
sender: IpcSender<Result<Uuid, BlobURLStoreError>>,
|
sender: IpcSender<Result<Uuid, BlobURLStoreError>>,
|
||||||
origin: FileOrigin) {
|
origin: FileOrigin) {
|
||||||
let store = self.store.clone();
|
let store = self.store.clone();
|
||||||
spawn_named("transfer memory".to_owned(), move || {
|
thread::Builder::new().name("transfer memory".to_owned()).spawn(move || {
|
||||||
store.promote_memory(blob_buf, set_valid, sender, origin);
|
store.promote_memory(blob_buf, set_valid, sender, origin);
|
||||||
})
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Message handler
|
/// Message handler
|
||||||
|
@ -157,15 +157,15 @@ impl FileManager {
|
||||||
match msg {
|
match msg {
|
||||||
FileManagerThreadMsg::SelectFile(filter, sender, origin, opt_test_path) => {
|
FileManagerThreadMsg::SelectFile(filter, sender, origin, opt_test_path) => {
|
||||||
let store = self.store.clone();
|
let store = self.store.clone();
|
||||||
spawn_named("select file".to_owned(), move || {
|
thread::Builder::new().name("select file".to_owned()).spawn(move || {
|
||||||
store.select_file(filter, sender, origin, opt_test_path, ui);
|
store.select_file(filter, sender, origin, opt_test_path, ui);
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
FileManagerThreadMsg::SelectFiles(filter, sender, origin, opt_test_paths) => {
|
FileManagerThreadMsg::SelectFiles(filter, sender, origin, opt_test_paths) => {
|
||||||
let store = self.store.clone();
|
let store = self.store.clone();
|
||||||
spawn_named("select files".to_owned(), move || {
|
thread::Builder::new().name("select files".to_owned()).spawn(move || {
|
||||||
store.select_files(filter, sender, origin, opt_test_paths, ui);
|
store.select_files(filter, sender, origin, opt_test_paths, ui);
|
||||||
})
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
FileManagerThreadMsg::ReadFile(sender, id, check_url_validity, origin) => {
|
FileManagerThreadMsg::ReadFile(sender, id, check_url_validity, origin) => {
|
||||||
self.read_file(sender, id, check_url_validity, origin);
|
self.read_file(sender, id, check_url_validity, origin);
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
use net_traits::IncludeSubdomains;
|
use net_traits::IncludeSubdomains;
|
||||||
use rustc_serialize::json::decode;
|
use rustc_serialize::json::decode;
|
||||||
|
use servo_config::resource_files::read_resource_file;
|
||||||
use std::net::{Ipv4Addr, Ipv6Addr};
|
use std::net::{Ipv4Addr, Ipv6Addr};
|
||||||
use std::str::from_utf8;
|
use std::str::from_utf8;
|
||||||
use time;
|
use time;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use util::resource_files::read_resource_file;
|
|
||||||
|
|
||||||
#[derive(RustcDecodable, RustcEncodable, Clone)]
|
#[derive(RustcDecodable, RustcEncodable, Clone)]
|
||||||
pub struct HstsEntry {
|
pub struct HstsEntry {
|
||||||
|
|
|
@ -47,11 +47,11 @@ use std::ops::Deref;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
|
use std::thread;
|
||||||
use time;
|
use time;
|
||||||
use time::Tm;
|
use time::Tm;
|
||||||
use unicase::UniCase;
|
use unicase::UniCase;
|
||||||
use url::Origin as UrlOrigin;
|
use url::Origin as UrlOrigin;
|
||||||
use util::thread::spawn_named;
|
|
||||||
use uuid;
|
use uuid;
|
||||||
|
|
||||||
fn read_block<R: Read>(reader: &mut R) -> Result<Data, ()> {
|
fn read_block<R: Read>(reader: &mut R) -> Result<Data, ()> {
|
||||||
|
@ -1071,7 +1071,7 @@ fn http_network_fetch(request: Rc<Request>,
|
||||||
let devtools_sender = context.devtools_chan.clone();
|
let devtools_sender = context.devtools_chan.clone();
|
||||||
let meta_status = meta.status.clone();
|
let meta_status = meta.status.clone();
|
||||||
let meta_headers = meta.headers.clone();
|
let meta_headers = meta.headers.clone();
|
||||||
spawn_named(format!("fetch worker thread"), move || {
|
thread::Builder::new().name(format!("fetch worker thread")).spawn(move || {
|
||||||
match StreamedResponse::from_http_response(res) {
|
match StreamedResponse::from_http_response(res) {
|
||||||
Ok(mut res) => {
|
Ok(mut res) => {
|
||||||
*res_body.lock().unwrap() = ResponseBody::Receiving(vec![]);
|
*res_body.lock().unwrap() = ResponseBody::Receiving(vec![]);
|
||||||
|
@ -1123,7 +1123,7 @@ fn http_network_fetch(request: Rc<Request>,
|
||||||
let _ = done_sender.send(Data::Done);
|
let _ = done_sender.send(Data::Done);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
// TODO these substeps aren't possible yet
|
// TODO these substeps aren't possible yet
|
||||||
// Substep 1
|
// Substep 1
|
||||||
|
|
|
@ -11,6 +11,7 @@ use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheCommand, ImageCac
|
||||||
use net_traits::image_cache_thread::{ImageCacheResult, ImageOrMetadataAvailable, ImageResponse, UsePlaceholder};
|
use net_traits::image_cache_thread::{ImageCacheResult, ImageOrMetadataAvailable, ImageResponse, UsePlaceholder};
|
||||||
use net_traits::image_cache_thread::ImageResponder;
|
use net_traits::image_cache_thread::ImageResponder;
|
||||||
use net_traits::request::{Destination, RequestInit, Type as RequestType};
|
use net_traits::request::{Destination, RequestInit, Type as RequestType};
|
||||||
|
use servo_config::resource_files::resources_dir_path;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
@ -20,9 +21,8 @@ use std::io::{self, Read};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::sync::mpsc::{Receiver, Sender, channel};
|
use std::sync::mpsc::{Receiver, Sender, channel};
|
||||||
|
use std::thread;
|
||||||
use threadpool::ThreadPool;
|
use threadpool::ThreadPool;
|
||||||
use util::resource_files::resources_dir_path;
|
|
||||||
use util::thread::spawn_named;
|
|
||||||
use webrender_traits;
|
use webrender_traits;
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -648,9 +648,9 @@ pub fn new_image_cache_thread(core_resource_thread: CoreResourceThread,
|
||||||
webrender_api: webrender_traits::RenderApi) -> ImageCacheThread {
|
webrender_api: webrender_traits::RenderApi) -> ImageCacheThread {
|
||||||
let (ipc_command_sender, ipc_command_receiver) = ipc::channel().unwrap();
|
let (ipc_command_sender, ipc_command_receiver) = ipc::channel().unwrap();
|
||||||
|
|
||||||
spawn_named("ImageCacheThread".to_owned(), move || {
|
thread::Builder::new().name("ImageCacheThread".to_owned()).spawn(move || {
|
||||||
ImageCache::run(core_resource_thread, webrender_api, ipc_command_receiver)
|
ImageCache::run(core_resource_thread, webrender_api, ipc_command_receiver)
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
ImageCacheThread::new(ipc_command_sender)
|
ImageCacheThread::new(ipc_command_sender)
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ extern crate profile_traits;
|
||||||
extern crate rustc_serialize;
|
extern crate rustc_serialize;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
extern crate servo_config;
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
extern crate threadpool;
|
extern crate threadpool;
|
||||||
extern crate time;
|
extern crate time;
|
||||||
|
@ -42,7 +43,6 @@ extern crate time;
|
||||||
extern crate tinyfiledialogs;
|
extern crate tinyfiledialogs;
|
||||||
extern crate unicase;
|
extern crate unicase;
|
||||||
extern crate url;
|
extern crate url;
|
||||||
extern crate util;
|
|
||||||
extern crate uuid;
|
extern crate uuid;
|
||||||
extern crate webrender_traits;
|
extern crate webrender_traits;
|
||||||
extern crate websocket;
|
extern crate websocket;
|
||||||
|
|
|
@ -37,8 +37,8 @@ use std::path::{Path, PathBuf};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
use std::sync::mpsc::Sender;
|
use std::sync::mpsc::Sender;
|
||||||
|
use std::thread;
|
||||||
use storage_thread::StorageThreadFactory;
|
use storage_thread::StorageThreadFactory;
|
||||||
use util::thread::spawn_named;
|
|
||||||
use websocket_loader;
|
use websocket_loader;
|
||||||
|
|
||||||
const TFD_PROVIDER: &'static TFDProvider = &TFDProvider;
|
const TFD_PROVIDER: &'static TFDProvider = &TFDProvider;
|
||||||
|
@ -76,7 +76,7 @@ pub fn new_core_resource_thread(user_agent: Cow<'static, str>,
|
||||||
-> (CoreResourceThread, CoreResourceThread) {
|
-> (CoreResourceThread, CoreResourceThread) {
|
||||||
let (public_setup_chan, public_setup_port) = ipc::channel().unwrap();
|
let (public_setup_chan, public_setup_port) = ipc::channel().unwrap();
|
||||||
let (private_setup_chan, private_setup_port) = ipc::channel().unwrap();
|
let (private_setup_chan, private_setup_port) = ipc::channel().unwrap();
|
||||||
spawn_named("ResourceManager".to_owned(), move || {
|
thread::Builder::new().name("ResourceManager".to_owned()).spawn(move || {
|
||||||
let resource_manager = CoreResourceManager::new(
|
let resource_manager = CoreResourceManager::new(
|
||||||
user_agent, devtools_chan, profiler_chan
|
user_agent, devtools_chan, profiler_chan
|
||||||
);
|
);
|
||||||
|
@ -87,7 +87,7 @@ pub fn new_core_resource_thread(user_agent: Cow<'static, str>,
|
||||||
};
|
};
|
||||||
channel_manager.start(public_setup_port,
|
channel_manager.start(public_setup_port,
|
||||||
private_setup_port);
|
private_setup_port);
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
(public_setup_chan, private_setup_chan)
|
(public_setup_chan, private_setup_chan)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ impl CoreResourceManager {
|
||||||
let ua = self.user_agent.clone();
|
let ua = self.user_agent.clone();
|
||||||
let dc = self.devtools_chan.clone();
|
let dc = self.devtools_chan.clone();
|
||||||
let filemanager = self.filemanager.clone();
|
let filemanager = self.filemanager.clone();
|
||||||
spawn_named(format!("fetch thread for {}", init.url), move || {
|
thread::Builder::new().name(format!("fetch thread for {}", init.url)).spawn(move || {
|
||||||
let request = Request::from_init(init);
|
let request = Request::from_init(init);
|
||||||
// XXXManishearth: Check origin against pipeline id (also ensure that the mode is allowed)
|
// XXXManishearth: Check origin against pipeline id (also ensure that the mode is allowed)
|
||||||
// todo load context / mimesniff in fetch
|
// todo load context / mimesniff in fetch
|
||||||
|
@ -357,7 +357,7 @@ impl CoreResourceManager {
|
||||||
filemanager: filemanager,
|
filemanager: filemanager,
|
||||||
};
|
};
|
||||||
fetch(Rc::new(request), &mut target, &context);
|
fetch(Rc::new(request), &mut target, &context);
|
||||||
})
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn websocket_connect(&self,
|
fn websocket_connect(&self,
|
||||||
|
|
|
@ -10,7 +10,7 @@ use std::borrow::ToOwned;
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use util::thread::spawn_named;
|
use std::thread;
|
||||||
|
|
||||||
const QUOTA_SIZE_LIMIT: usize = 5 * 1024 * 1024;
|
const QUOTA_SIZE_LIMIT: usize = 5 * 1024 * 1024;
|
||||||
|
|
||||||
|
@ -22,9 +22,9 @@ impl StorageThreadFactory for IpcSender<StorageThreadMsg> {
|
||||||
/// Create a storage thread
|
/// Create a storage thread
|
||||||
fn new(config_dir: Option<PathBuf>) -> IpcSender<StorageThreadMsg> {
|
fn new(config_dir: Option<PathBuf>) -> IpcSender<StorageThreadMsg> {
|
||||||
let (chan, port) = ipc::channel().unwrap();
|
let (chan, port) = ipc::channel().unwrap();
|
||||||
spawn_named("StorageManager".to_owned(), move || {
|
thread::Builder::new().name("StorageManager".to_owned()).spawn(move || {
|
||||||
StorageManager::new(port, config_dir).start();
|
StorageManager::new(port, config_dir).start();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
chan
|
chan
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ use std::ascii::AsciiExt;
|
||||||
use std::sync::{Arc, Mutex, RwLock};
|
use std::sync::{Arc, Mutex, RwLock};
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use util::thread::spawn_named;
|
|
||||||
use websocket::{Client, Message};
|
use websocket::{Client, Message};
|
||||||
use websocket::header::{Headers, Origin, WebSocketProtocol};
|
use websocket::header::{Headers, Origin, WebSocketProtocol};
|
||||||
use websocket::message::Type;
|
use websocket::message::Type;
|
||||||
|
@ -64,7 +63,7 @@ fn establish_a_websocket_connection(resource_url: &ServoUrl, net_url: (Host, Str
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(connect: WebSocketCommunicate, connect_data: WebSocketConnectData, cookie_jar: Arc<RwLock<CookieStorage>>) {
|
pub fn init(connect: WebSocketCommunicate, connect_data: WebSocketConnectData, cookie_jar: Arc<RwLock<CookieStorage>>) {
|
||||||
spawn_named(format!("WebSocket connection to {}", connect_data.resource_url), move || {
|
thread::Builder::new().name(format!("WebSocket connection to {}", connect_data.resource_url)).spawn(move || {
|
||||||
// Step 8: Protocols.
|
// Step 8: Protocols.
|
||||||
|
|
||||||
// Step 9.
|
// Step 9.
|
||||||
|
@ -162,5 +161,5 @@ pub fn init(connect: WebSocketCommunicate, connect_data: WebSocketConnectData, c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ path = "lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bluetooth_traits = {path = "../bluetooth_traits"}
|
bluetooth_traits = {path = "../bluetooth_traits"}
|
||||||
util = {path = "../util"}
|
|
||||||
msg = {path = "../msg"}
|
msg = {path = "../msg"}
|
||||||
ipc-channel = "0.5"
|
ipc-channel = "0.5"
|
||||||
heapsize = "0.3.0"
|
heapsize = "0.3.0"
|
||||||
|
@ -24,6 +23,7 @@ log = "0.3.5"
|
||||||
num-traits = "0.1.32"
|
num-traits = "0.1.32"
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
|
servo_config = {path = "../config", features = ["servo"]}
|
||||||
servo_url = {path = "../url", features = ["servo"]}
|
servo_url = {path = "../url", features = ["servo"]}
|
||||||
url = {version = "1.2", features = ["heap_size"]}
|
url = {version = "1.2", features = ["heap_size"]}
|
||||||
websocket = "0.17"
|
websocket = "0.17"
|
||||||
|
|
|
@ -27,9 +27,9 @@ extern crate num_traits;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
extern crate servo_config;
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
extern crate url;
|
extern crate url;
|
||||||
extern crate util;
|
|
||||||
extern crate uuid;
|
extern crate uuid;
|
||||||
extern crate webrender_traits;
|
extern crate webrender_traits;
|
||||||
extern crate websocket;
|
extern crate websocket;
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
//! we don't need to make the code more complex for it. The `mach` update command makes sure that
|
//! we don't need to make the code more complex for it. The `mach` update command makes sure that
|
||||||
//! those cases are not present.
|
//! those cases are not present.
|
||||||
|
|
||||||
|
use servo_config::resource_files::read_resource_file;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::iter::FromIterator;
|
use std::iter::FromIterator;
|
||||||
use std::str::from_utf8;
|
use std::str::from_utf8;
|
||||||
use util::resource_files::read_resource_file;
|
|
||||||
|
|
||||||
#[derive(Clone,Debug)]
|
#[derive(Clone,Debug)]
|
||||||
pub struct PubDomainRules {
|
pub struct PubDomainRules {
|
||||||
|
|
|
@ -12,13 +12,13 @@ path = "lib.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
profile_traits = {path = "../profile_traits"}
|
profile_traits = {path = "../profile_traits"}
|
||||||
plugins = {path = "../plugins"}
|
plugins = {path = "../plugins"}
|
||||||
util = {path = "../util", features = ["servo"]}
|
|
||||||
ipc-channel = "0.5"
|
ipc-channel = "0.5"
|
||||||
heartbeats-simple = "0.3"
|
heartbeats-simple = "0.3"
|
||||||
log = "0.3.5"
|
log = "0.3.5"
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
serde_json = "0.8"
|
serde_json = "0.8"
|
||||||
|
servo_config = {path = "../config", features = ["servo"]}
|
||||||
time = "0.1.12"
|
time = "0.1.12"
|
||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
use heartbeats_simple::HeartbeatPow as Heartbeat;
|
use heartbeats_simple::HeartbeatPow as Heartbeat;
|
||||||
use heartbeats_simple::HeartbeatPowContext as HeartbeatContext;
|
use heartbeats_simple::HeartbeatPowContext as HeartbeatContext;
|
||||||
use profile_traits::time::ProfilerCategory;
|
use profile_traits::time::ProfilerCategory;
|
||||||
|
use servo_config::opts;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env::var_os;
|
use std::env::var_os;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use util::opts;
|
|
||||||
|
|
||||||
|
|
||||||
static mut HBS: Option<*mut HashMap<ProfilerCategory, Heartbeat>> = None;
|
static mut HBS: Option<*mut HashMap<ProfilerCategory, Heartbeat>> = None;
|
||||||
|
|
|
@ -27,10 +27,10 @@ extern crate serde;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
|
extern crate servo_config;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
extern crate task_info;
|
extern crate task_info;
|
||||||
extern crate time as std_time;
|
extern crate time as std_time;
|
||||||
extern crate util;
|
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
mod heartbeats;
|
mod heartbeats;
|
||||||
|
|
|
@ -13,7 +13,6 @@ use std::cmp::Ordering;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use time::duration_from_seconds;
|
use time::duration_from_seconds;
|
||||||
use util::thread::spawn_named;
|
|
||||||
|
|
||||||
pub struct Profiler {
|
pub struct Profiler {
|
||||||
/// The port through which messages are received.
|
/// The port through which messages are received.
|
||||||
|
@ -33,22 +32,22 @@ impl Profiler {
|
||||||
// Create the timer thread if a period was provided.
|
// Create the timer thread if a period was provided.
|
||||||
if let Some(period) = period {
|
if let Some(period) = period {
|
||||||
let chan = chan.clone();
|
let chan = chan.clone();
|
||||||
spawn_named("Memory profiler timer".to_owned(), move || {
|
thread::Builder::new().name("Memory profiler timer".to_owned()).spawn(move || {
|
||||||
loop {
|
loop {
|
||||||
thread::sleep(duration_from_seconds(period));
|
thread::sleep(duration_from_seconds(period));
|
||||||
if chan.send(ProfilerMsg::Print).is_err() {
|
if chan.send(ProfilerMsg::Print).is_err() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always spawn the memory profiler. If there is no timer thread it won't receive regular
|
// Always spawn the memory profiler. If there is no timer thread it won't receive regular
|
||||||
// `Print` events, but it will still receive the other events.
|
// `Print` events, but it will still receive the other events.
|
||||||
spawn_named("Memory profiler".to_owned(), move || {
|
thread::Builder::new().name("Memory profiler".to_owned()).spawn(move || {
|
||||||
let mut mem_profiler = Profiler::new(port);
|
let mut mem_profiler = Profiler::new(port);
|
||||||
mem_profiler.start();
|
mem_profiler.start();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
let mem_profiler_chan = ProfilerChan(chan);
|
let mem_profiler_chan = ProfilerChan(chan);
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ use ipc_channel::ipc::{self, IpcReceiver};
|
||||||
use profile_traits::energy::{energy_interval_ms, read_energy_uj};
|
use profile_traits::energy::{energy_interval_ms, read_energy_uj};
|
||||||
use profile_traits::time::{ProfilerCategory, ProfilerChan, ProfilerMsg, TimerMetadata};
|
use profile_traits::time::{ProfilerCategory, ProfilerChan, ProfilerMsg, TimerMetadata};
|
||||||
use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType};
|
use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType};
|
||||||
|
use servo_config::opts::OutputOptions;
|
||||||
use std::{f64, thread, u32, u64};
|
use std::{f64, thread, u32, u64};
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
@ -22,8 +23,6 @@ use std::path::Path;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std_time::precise_time_ns;
|
use std_time::precise_time_ns;
|
||||||
use trace_dump::TraceDump;
|
use trace_dump::TraceDump;
|
||||||
use util::opts::OutputOptions;
|
|
||||||
use util::thread::spawn_named;
|
|
||||||
|
|
||||||
pub trait Formattable {
|
pub trait Formattable {
|
||||||
fn format(&self, output: &Option<OutputOptions>) -> String;
|
fn format(&self, output: &Option<OutputOptions>) -> String;
|
||||||
|
@ -176,28 +175,28 @@ impl Profiler {
|
||||||
Some(ref option) => {
|
Some(ref option) => {
|
||||||
// Spawn the time profiler thread
|
// Spawn the time profiler thread
|
||||||
let outputoption = option.clone();
|
let outputoption = option.clone();
|
||||||
spawn_named("Time profiler".to_owned(), move || {
|
thread::Builder::new().name("Time profiler".to_owned()).spawn(move || {
|
||||||
let trace = file_path.as_ref()
|
let trace = file_path.as_ref()
|
||||||
.map(path::Path::new)
|
.map(path::Path::new)
|
||||||
.map(fs::File::create)
|
.map(fs::File::create)
|
||||||
.map(|res| TraceDump::new(res.unwrap()));
|
.map(|res| TraceDump::new(res.unwrap()));
|
||||||
let mut profiler = Profiler::new(port, trace, Some(outputoption));
|
let mut profiler = Profiler::new(port, trace, Some(outputoption));
|
||||||
profiler.start();
|
profiler.start();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
// decide if we need to spawn the timer thread
|
// decide if we need to spawn the timer thread
|
||||||
match option {
|
match option {
|
||||||
&OutputOptions::FileName(_) => { /* no timer thread needed */ },
|
&OutputOptions::FileName(_) => { /* no timer thread needed */ },
|
||||||
&OutputOptions::Stdout(period) => {
|
&OutputOptions::Stdout(period) => {
|
||||||
// Spawn a timer thread
|
// Spawn a timer thread
|
||||||
let chan = chan.clone();
|
let chan = chan.clone();
|
||||||
spawn_named("Time profiler timer".to_owned(), move || {
|
thread::Builder::new().name("Time profiler timer".to_owned()).spawn(move || {
|
||||||
loop {
|
loop {
|
||||||
thread::sleep(duration_from_seconds(period));
|
thread::sleep(duration_from_seconds(period));
|
||||||
if chan.send(ProfilerMsg::Print).is_err() {
|
if chan.send(ProfilerMsg::Print).is_err() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -205,17 +204,17 @@ impl Profiler {
|
||||||
// this is when the -p option hasn't been specified
|
// this is when the -p option hasn't been specified
|
||||||
if file_path.is_some() {
|
if file_path.is_some() {
|
||||||
// Spawn the time profiler
|
// Spawn the time profiler
|
||||||
spawn_named("Time profiler".to_owned(), move || {
|
thread::Builder::new().name("Time profiler".to_owned()).spawn(move || {
|
||||||
let trace = file_path.as_ref()
|
let trace = file_path.as_ref()
|
||||||
.map(path::Path::new)
|
.map(path::Path::new)
|
||||||
.map(fs::File::create)
|
.map(fs::File::create)
|
||||||
.map(|res| TraceDump::new(res.unwrap()));
|
.map(|res| TraceDump::new(res.unwrap()));
|
||||||
let mut profiler = Profiler::new(port, trace, None);
|
let mut profiler = Profiler::new(port, trace, None);
|
||||||
profiler.start();
|
profiler.start();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
} else {
|
} else {
|
||||||
// No-op to handle messages when the time profiler is not printing:
|
// No-op to handle messages when the time profiler is not printing:
|
||||||
spawn_named("Time profiler".to_owned(), move || {
|
thread::Builder::new().name("Time profiler".to_owned()).spawn(move || {
|
||||||
loop {
|
loop {
|
||||||
match port.recv() {
|
match port.recv() {
|
||||||
Err(_) => break,
|
Err(_) => break,
|
||||||
|
@ -226,7 +225,7 @@ impl Profiler {
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,7 +246,7 @@ impl Profiler {
|
||||||
const MAX_ENERGY_INTERVAL_MS: u32 = 1000;
|
const MAX_ENERGY_INTERVAL_MS: u32 = 1000;
|
||||||
let interval_ms = enforce_range(MIN_ENERGY_INTERVAL_MS, MAX_ENERGY_INTERVAL_MS, energy_interval_ms());
|
let interval_ms = enforce_range(MIN_ENERGY_INTERVAL_MS, MAX_ENERGY_INTERVAL_MS, energy_interval_ms());
|
||||||
let loop_count: u32 = (interval_ms as f32 / SLEEP_MS as f32).ceil() as u32;
|
let loop_count: u32 = (interval_ms as f32 / SLEEP_MS as f32).ceil() as u32;
|
||||||
spawn_named("Application heartbeat profiler".to_owned(), move || {
|
thread::Builder::new().name("Application heartbeat profiler".to_owned()).spawn(move || {
|
||||||
let mut start_time = precise_time_ns();
|
let mut start_time = precise_time_ns();
|
||||||
let mut start_energy = read_energy_uj();
|
let mut start_energy = read_energy_uj();
|
||||||
loop {
|
loop {
|
||||||
|
@ -272,7 +271,7 @@ impl Profiler {
|
||||||
start_time = end_time;
|
start_time = end_time;
|
||||||
start_energy = end_energy;
|
start_energy = end_energy;
|
||||||
}
|
}
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
profiler_chan
|
profiler_chan
|
||||||
|
|
|
@ -20,7 +20,7 @@ log = "0.3.5"
|
||||||
plugins = {path = "../plugins"}
|
plugins = {path = "../plugins"}
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
serde_derive = "0.8"
|
serde_derive = "0.8"
|
||||||
|
servo_config = {path = "../config"}
|
||||||
signpost = {git = "https://github.com/pcwalton/signpost.git"}
|
signpost = {git = "https://github.com/pcwalton/signpost.git"}
|
||||||
time = "0.1.12"
|
time = "0.1.12"
|
||||||
util = {path = "../util"}
|
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ extern crate log;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
extern crate servo_config;
|
||||||
extern crate signpost;
|
extern crate signpost;
|
||||||
extern crate util;
|
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
pub mod energy;
|
pub mod energy;
|
||||||
|
|
|
@ -7,8 +7,8 @@ extern crate time as std_time;
|
||||||
use energy::read_energy_uj;
|
use energy::read_energy_uj;
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
use self::std_time::precise_time_ns;
|
use self::std_time::precise_time_ns;
|
||||||
|
use servo_config::opts;
|
||||||
use signpost;
|
use signpost;
|
||||||
use util::opts;
|
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, PartialOrd, Eq, Ord, Debug, Deserialize, Serialize)]
|
#[derive(PartialEq, Clone, PartialOrd, Eq, Ord, Debug, Deserialize, Serialize)]
|
||||||
pub struct TimerMetadata {
|
pub struct TimerMetadata {
|
||||||
|
|
14
components/remutex/Cargo.toml
Normal file
14
components/remutex/Cargo.toml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
[package]
|
||||||
|
name = "servo_remutex"
|
||||||
|
version = "0.0.1"
|
||||||
|
authors = ["The Servo Project Developers"]
|
||||||
|
license = "MPL-2.0"
|
||||||
|
publish = false
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "servo_remutex"
|
||||||
|
path = "lib.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
lazy_static = "0.2"
|
||||||
|
log = "0.3.5"
|
|
@ -10,6 +10,12 @@
|
||||||
//! It provides the same interface as https://github.com/rust-lang/rust/blob/master/src/libstd/sys/common/remutex.rs
|
//! It provides the same interface as https://github.com/rust-lang/rust/blob/master/src/libstd/sys/common/remutex.rs
|
||||||
//! so if those types are ever exported, we should be able to replace this implemtation.
|
//! so if those types are ever exported, we should be able to replace this implemtation.
|
||||||
|
|
||||||
|
#![feature(nonzero)]
|
||||||
|
|
||||||
|
extern crate core;
|
||||||
|
#[macro_use] extern crate lazy_static;
|
||||||
|
#[macro_use] extern crate log;
|
||||||
|
|
||||||
use core::nonzero::NonZero;
|
use core::nonzero::NonZero;
|
||||||
use std::cell::{Cell, UnsafeCell};
|
use std::cell::{Cell, UnsafeCell};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
|
@ -70,13 +70,14 @@ script_traits = {path = "../script_traits"}
|
||||||
selectors = "0.15"
|
selectors = "0.15"
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
servo_atoms = {path = "../atoms"}
|
servo_atoms = {path = "../atoms"}
|
||||||
|
servo_config = {path = "../config", features = ["servo"] }
|
||||||
|
servo_geometry = {path = "../geometry" }
|
||||||
servo_url = {path = "../url", features = ["servo"] }
|
servo_url = {path = "../url", features = ["servo"] }
|
||||||
smallvec = "0.1"
|
smallvec = "0.1"
|
||||||
style = {path = "../style"}
|
style = {path = "../style"}
|
||||||
style_traits = {path = "../style_traits"}
|
style_traits = {path = "../style_traits"}
|
||||||
time = "0.1.12"
|
time = "0.1.12"
|
||||||
url = {version = "1.2", features = ["heap_size", "query_encoding"]}
|
url = {version = "1.2", features = ["heap_size", "query_encoding"]}
|
||||||
util = {path = "../util"}
|
|
||||||
uuid = {version = "0.3.1", features = ["v4"]}
|
uuid = {version = "0.3.1", features = ["v4"]}
|
||||||
websocket = "0.17"
|
websocket = "0.17"
|
||||||
xml5ever = {version = "0.2", features = ["unstable"]}
|
xml5ever = {version = "0.2", features = ["unstable"]}
|
||||||
|
|
|
@ -5603,7 +5603,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'dom::globalscope::GlobalScope',
|
'dom::globalscope::GlobalScope',
|
||||||
'mem::heap_size_of_raw_self_and_children',
|
'mem::heap_size_of_raw_self_and_children',
|
||||||
'libc',
|
'libc',
|
||||||
'util::prefs::PREFS',
|
'servo_config::prefs::PREFS',
|
||||||
'std::borrow::ToOwned',
|
'std::borrow::ToOwned',
|
||||||
'std::cmp',
|
'std::cmp',
|
||||||
'std::mem',
|
'std::mem',
|
||||||
|
|
|
@ -56,8 +56,8 @@ use js::jsval::{ObjectValue, StringValue};
|
||||||
use js::rust::{ToString, get_object_class, is_dom_class, is_dom_object, maybe_wrap_value};
|
use js::rust::{ToString, get_object_class, is_dom_class, is_dom_object, maybe_wrap_value};
|
||||||
use libc;
|
use libc;
|
||||||
use num_traits::Float;
|
use num_traits::Float;
|
||||||
|
use servo_config::opts;
|
||||||
use std::{char, mem, ptr, slice};
|
use std::{char, mem, ptr, slice};
|
||||||
use util::opts;
|
|
||||||
|
|
||||||
/// A trait to check whether a given `JSObject` implements an IDL interface.
|
/// A trait to check whether a given `JSObject` implements an IDL interface.
|
||||||
pub trait IDLInterface {
|
pub trait IDLInterface {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
//! Machinery to conditionally expose things.
|
//! Machinery to conditionally expose things.
|
||||||
|
|
||||||
use js::jsapi::{HandleObject, JSContext};
|
use js::jsapi::{HandleObject, JSContext};
|
||||||
use util::prefs::PREFS;
|
use servo_config::prefs::PREFS;
|
||||||
|
|
||||||
/// A container with a condition.
|
/// A container with a condition.
|
||||||
pub struct Guard<T: Clone + Copy> {
|
pub struct Guard<T: Clone + Copy> {
|
||||||
|
|
|
@ -19,8 +19,8 @@ use dom::element::Element;
|
||||||
use dom::node::{Node, NodeDamage};
|
use dom::node::{Node, NodeDamage};
|
||||||
use dom::processinginstruction::ProcessingInstruction;
|
use dom::processinginstruction::ProcessingInstruction;
|
||||||
use dom::text::Text;
|
use dom::text::Text;
|
||||||
|
use servo_config::opts;
|
||||||
use std::cell::Ref;
|
use std::cell::Ref;
|
||||||
use util::opts;
|
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#characterdata
|
// https://dom.spec.whatwg.org/#characterdata
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -78,7 +78,7 @@ use dom::htmlunknownelement::HTMLUnknownElement;
|
||||||
use dom::htmlvideoelement::HTMLVideoElement;
|
use dom::htmlvideoelement::HTMLVideoElement;
|
||||||
use dom::svgsvgelement::SVGSVGElement;
|
use dom::svgsvgelement::SVGSVGElement;
|
||||||
use html5ever_atoms::{Prefix, QualName};
|
use html5ever_atoms::{Prefix, QualName};
|
||||||
use util::prefs::PREFS;
|
use servo_config::prefs::PREFS;
|
||||||
|
|
||||||
fn create_svg_element(name: QualName,
|
fn create_svg_element(name: QualName,
|
||||||
prefix: Option<DOMString>,
|
prefix: Option<DOMString>,
|
||||||
|
|
|
@ -38,8 +38,8 @@ use std::mem::replace;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::sync::atomic::AtomicBool;
|
use std::sync::atomic::AtomicBool;
|
||||||
use std::sync::mpsc::{Receiver, RecvError, Select, Sender, channel};
|
use std::sync::mpsc::{Receiver, RecvError, Select, Sender, channel};
|
||||||
|
use std::thread;
|
||||||
use style::thread_state;
|
use style::thread_state;
|
||||||
use util::thread::spawn_named;
|
|
||||||
|
|
||||||
/// Set the `worker` field of a related DedicatedWorkerGlobalScope object to a particular
|
/// Set the `worker` field of a related DedicatedWorkerGlobalScope object to a particular
|
||||||
/// value for the duration of this object's lifetime. This ensures that the related Worker
|
/// value for the duration of this object's lifetime. This ensures that the related Worker
|
||||||
|
@ -160,7 +160,7 @@ impl DedicatedWorkerGlobalScope {
|
||||||
let name = format!("WebWorker for {}", serialized_worker_url);
|
let name = format!("WebWorker for {}", serialized_worker_url);
|
||||||
let top_level_frame_id = FrameId::installed();
|
let top_level_frame_id = FrameId::installed();
|
||||||
|
|
||||||
spawn_named(name, move || {
|
thread::Builder::new().name(name).spawn(move || {
|
||||||
thread_state::initialize(thread_state::SCRIPT | thread_state::IN_WORKER);
|
thread_state::initialize(thread_state::SCRIPT | thread_state::IN_WORKER);
|
||||||
|
|
||||||
if let Some(top_level_frame_id) = top_level_frame_id {
|
if let Some(top_level_frame_id) = top_level_frame_id {
|
||||||
|
@ -243,7 +243,7 @@ impl DedicatedWorkerGlobalScope {
|
||||||
global.handle_event(event);
|
global.handle_event(event);
|
||||||
}
|
}
|
||||||
}, reporter_name, parent_sender, CommonScriptMsg::CollectReports);
|
}, reporter_name, parent_sender, CommonScriptMsg::CollectReports);
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
||||||
|
|
|
@ -113,6 +113,7 @@ use script_traits::{ScriptMsg as ConstellationMsg, TouchpadPressurePhase};
|
||||||
use script_traits::{TouchEventType, TouchId};
|
use script_traits::{TouchEventType, TouchId};
|
||||||
use script_traits::UntrustedNodeAddress;
|
use script_traits::UntrustedNodeAddress;
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
|
@ -133,7 +134,6 @@ use style::str::{split_html_space_chars, str_join};
|
||||||
use style::stylesheets::Stylesheet;
|
use style::stylesheets::Stylesheet;
|
||||||
use time;
|
use time;
|
||||||
use url::percent_encoding::percent_decode;
|
use url::percent_encoding::percent_decode;
|
||||||
use util::prefs::PREFS;
|
|
||||||
|
|
||||||
pub enum TouchEventResult {
|
pub enum TouchEventResult {
|
||||||
Processed(bool),
|
Processed(bool),
|
||||||
|
|
|
@ -34,9 +34,9 @@ use servo_atoms::Atom;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
use std::thread;
|
||||||
use task_source::TaskSource;
|
use task_source::TaskSource;
|
||||||
use task_source::file_reading::{FileReadingTaskSource, FileReadingRunnable, FileReadingTask};
|
use task_source::file_reading::{FileReadingTaskSource, FileReadingRunnable, FileReadingTask};
|
||||||
use util::thread::spawn_named;
|
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)]
|
#[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)]
|
||||||
pub enum FileReaderFunction {
|
pub enum FileReaderFunction {
|
||||||
|
@ -401,9 +401,10 @@ impl FileReader {
|
||||||
let wrapper = global.get_runnable_wrapper();
|
let wrapper = global.get_runnable_wrapper();
|
||||||
let task_source = global.file_reading_task_source();
|
let task_source = global.file_reading_task_source();
|
||||||
|
|
||||||
spawn_named("file reader async operation".to_owned(), move || {
|
thread::Builder::new().name("file reader async operation".to_owned()).spawn(move || {
|
||||||
perform_annotated_read_operation(gen_id, load_data, blob_contents, fr, task_source, wrapper)
|
perform_annotated_read_operation(gen_id, load_data, blob_contents, fr, task_source, wrapper)
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,10 @@ use html5ever_atoms::LocalName;
|
||||||
use net_traits::ReferrerPolicy;
|
use net_traits::ReferrerPolicy;
|
||||||
use num_traits::ToPrimitive;
|
use num_traits::ToPrimitive;
|
||||||
use script_traits::MozBrowserEvent;
|
use script_traits::MozBrowserEvent;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
use util::prefs::PREFS;
|
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLAnchorElement {
|
pub struct HTMLAnchorElement {
|
||||||
|
|
|
@ -48,13 +48,13 @@ use script_traits::{IFrameLoadInfo, IFrameLoadInfoWithData, LoadData};
|
||||||
use script_traits::{MozBrowserEvent, NewLayoutInfo, ScriptMsg as ConstellationMsg};
|
use script_traits::{MozBrowserEvent, NewLayoutInfo, ScriptMsg as ConstellationMsg};
|
||||||
use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};
|
use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
|
use servo_config::servo_version;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||||
use style::context::ReflowGoal;
|
use style::context::ReflowGoal;
|
||||||
use task_source::TaskSource;
|
use task_source::TaskSource;
|
||||||
use util::prefs::PREFS;
|
|
||||||
use util::servo_version;
|
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(JSTraceable, HeapSizeOf)]
|
#[derive(JSTraceable, HeapSizeOf)]
|
||||||
|
|
|
@ -19,6 +19,7 @@ use dom::node::{Node, UnbindContext, document_from_node, window_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever_atoms::LocalName;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::sync::atomic::AtomicBool;
|
use std::sync::atomic::AtomicBool;
|
||||||
|
@ -89,7 +90,7 @@ impl HTMLMetaElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply_viewport(&self) {
|
fn apply_viewport(&self) {
|
||||||
if !::util::prefs::PREFS.get("layout.viewport.enabled").as_boolean().unwrap_or(false) {
|
if !PREFS.get("layout.viewport.enabled").as_boolean().unwrap_or(false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let element = self.upcast::<Element>();
|
let element = self.upcast::<Element>();
|
||||||
|
|
|
@ -14,9 +14,9 @@ use dom::event::{Event, EventBubbles, EventCancelable};
|
||||||
use dom::eventtarget::EventTarget;
|
use dom::eventtarget::EventTarget;
|
||||||
use dom::uievent::UIEvent;
|
use dom::uievent::UIEvent;
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use util::prefs::PREFS;
|
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct MouseEvent {
|
pub struct MouseEvent {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use util::opts;
|
use servo_config::opts;
|
||||||
|
|
||||||
pub fn Product() -> DOMString {
|
pub fn Product() -> DOMString {
|
||||||
DOMString::from("Gecko")
|
DOMString::from("Gecko")
|
||||||
|
|
|
@ -28,13 +28,12 @@ use net_traits::request::{CredentialsMode, Destination, RequestInit, Type as Req
|
||||||
use rand::random;
|
use rand::random;
|
||||||
use script_runtime::{CommonScriptMsg, StackRootTLS, get_reports, new_rt_and_cx, ScriptChan};
|
use script_runtime::{CommonScriptMsg, StackRootTLS, get_reports, new_rt_and_cx, ScriptChan};
|
||||||
use script_traits::{TimerEvent, WorkerGlobalScopeInit, ScopeThings, ServiceWorkerMsg, WorkerScriptLoadOrigin};
|
use script_traits::{TimerEvent, WorkerGlobalScopeInit, ScopeThings, ServiceWorkerMsg, WorkerScriptLoadOrigin};
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::sync::mpsc::{Receiver, RecvError, Select, Sender, channel};
|
use std::sync::mpsc::{Receiver, RecvError, Select, Sender, channel};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use style::thread_state::{self, IN_WORKER, SCRIPT};
|
use style::thread_state::{self, IN_WORKER, SCRIPT};
|
||||||
use util::prefs::PREFS;
|
|
||||||
use util::thread::spawn_named;
|
|
||||||
|
|
||||||
/// Messages used to control service worker event loop
|
/// Messages used to control service worker event loop
|
||||||
pub enum ServiceWorkerScriptMsg {
|
pub enum ServiceWorkerScriptMsg {
|
||||||
|
@ -151,7 +150,7 @@ impl ServiceWorkerGlobalScope {
|
||||||
.. } = scope_things;
|
.. } = scope_things;
|
||||||
|
|
||||||
let serialized_worker_url = script_url.to_string();
|
let serialized_worker_url = script_url.to_string();
|
||||||
spawn_named(format!("ServiceWorker for {}", serialized_worker_url), move || {
|
thread::Builder::new().name(format!("ServiceWorker for {}", serialized_worker_url)).spawn(move || {
|
||||||
thread_state::initialize(SCRIPT | IN_WORKER);
|
thread_state::initialize(SCRIPT | IN_WORKER);
|
||||||
let roots = RootCollection::new();
|
let roots = RootCollection::new();
|
||||||
let _stack_roots_tls = StackRootTLS::new(&roots);
|
let _stack_roots_tls = StackRootTLS::new(&roots);
|
||||||
|
@ -202,11 +201,11 @@ impl ServiceWorkerGlobalScope {
|
||||||
|
|
||||||
scope.execute_script(DOMString::from(source));
|
scope.execute_script(DOMString::from(source));
|
||||||
// Service workers are time limited
|
// Service workers are time limited
|
||||||
spawn_named("SWTimeoutThread".to_owned(), move || {
|
thread::Builder::new().name("SWTimeoutThread".to_owned()).spawn(move || {
|
||||||
let sw_lifetime_timeout = PREFS.get("dom.serviceworker.timeout_seconds").as_u64().unwrap();
|
let sw_lifetime_timeout = PREFS.get("dom.serviceworker.timeout_seconds").as_u64().unwrap();
|
||||||
thread::sleep(Duration::new(sw_lifetime_timeout, 0));
|
thread::sleep(Duration::new(sw_lifetime_timeout, 0));
|
||||||
let _ = timer_chan.send(());
|
let _ = timer_chan.send(());
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
global.dispatch_activate();
|
global.dispatch_activate();
|
||||||
let reporter_name = format!("service-worker-reporter-{}", random::<u64>());
|
let reporter_name = format!("service-worker-reporter-{}", random::<u64>());
|
||||||
|
@ -217,7 +216,7 @@ impl ServiceWorkerGlobalScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, reporter_name, scope.script_chan(), CommonScriptMsg::CollectReports);
|
}, reporter_name, scope.script_chan(), CommonScriptMsg::CollectReports);
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_event(&self, event: MixedMessage) -> bool {
|
fn handle_event(&self, event: MixedMessage) -> bool {
|
||||||
|
|
|
@ -32,10 +32,10 @@ use network_listener::PreInvoke;
|
||||||
use profile_traits::time::{TimerMetadata, TimerMetadataFrameType};
|
use profile_traits::time::{TimerMetadata, TimerMetadataFrameType};
|
||||||
use profile_traits::time::{TimerMetadataReflowType, ProfilerCategory, profile};
|
use profile_traits::time::{TimerMetadataReflowType, ProfilerCategory, profile};
|
||||||
use script_thread::ScriptThread;
|
use script_thread::ScriptThread;
|
||||||
|
use servo_config::resource_files::read_resource_file;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use util::resource_files::read_resource_file;
|
|
||||||
|
|
||||||
mod html;
|
mod html;
|
||||||
mod xml;
|
mod xml;
|
||||||
|
|
|
@ -37,11 +37,11 @@ use js::jsapi::{HandleObject, HandleValue, JSContext, JSObject, JSAutoCompartmen
|
||||||
use js::jsapi::{JS_NewPlainObject, JS_NewUint8ClampedArray};
|
use js::jsapi::{JS_NewPlainObject, JS_NewUint8ClampedArray};
|
||||||
use js::jsval::{JSVal, NullValue};
|
use js::jsval::{JSVal, NullValue};
|
||||||
use script_traits::MsDuration;
|
use script_traits::MsDuration;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use timers::OneshotTimerCallback;
|
use timers::OneshotTimerCallback;
|
||||||
use util::prefs::PREFS;
|
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct TestBinding {
|
pub struct TestBinding {
|
||||||
|
|
|
@ -9,11 +9,11 @@ use dom::bindings::js::RootedReference;
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use dom::htmlheadelement::HTMLHeadElement;
|
use dom::htmlheadelement::HTMLHeadElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
|
use servo_config::opts;
|
||||||
|
use servo_config::resource_files::resources_dir_path;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::fs::read_dir;
|
use std::fs::read_dir;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use util::opts;
|
|
||||||
use util::resource_files::resources_dir_path;
|
|
||||||
|
|
||||||
|
|
||||||
pub fn load_script(head: &HTMLHeadElement) {
|
pub fn load_script(head: &HTMLHeadElement) {
|
||||||
|
|
|
@ -77,6 +77,9 @@ use script_traits::{DocumentState, TimerEvent, TimerEventId};
|
||||||
use script_traits::{ScriptMsg as ConstellationMsg, TimerEventRequest, WindowSizeData, WindowSizeType};
|
use script_traits::{ScriptMsg as ConstellationMsg, TimerEventRequest, WindowSizeData, WindowSizeType};
|
||||||
use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
|
use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
|
use servo_config::opts;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
|
use servo_geometry::{f32_rect_to_au_rect, max_rect};
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
|
@ -106,9 +109,6 @@ use timers::{IsInterval, TimerCallback};
|
||||||
#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
|
#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
|
||||||
use tinyfiledialogs::{self, MessageBoxIcon};
|
use tinyfiledialogs::{self, MessageBoxIcon};
|
||||||
use url::Position;
|
use url::Position;
|
||||||
use util::geometry::{self, max_rect};
|
|
||||||
use util::opts;
|
|
||||||
use util::prefs::PREFS;
|
|
||||||
use webdriver_handlers::jsval_to_webdriver;
|
use webdriver_handlers::jsval_to_webdriver;
|
||||||
|
|
||||||
/// Current state of the window object
|
/// Current state of the window object
|
||||||
|
@ -1413,13 +1413,13 @@ impl Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_page_clip_rect_with_new_viewport(&self, viewport: Rect<f32>) -> bool {
|
pub fn set_page_clip_rect_with_new_viewport(&self, viewport: Rect<f32>) -> bool {
|
||||||
let rect = geometry::f32_rect_to_au_rect(viewport.clone());
|
let rect = f32_rect_to_au_rect(viewport.clone());
|
||||||
self.current_viewport.set(rect);
|
self.current_viewport.set(rect);
|
||||||
// We use a clipping rectangle that is five times the size of the of the viewport,
|
// We use a clipping rectangle that is five times the size of the of the viewport,
|
||||||
// so that we don't collect display list items for areas too far outside the viewport,
|
// so that we don't collect display list items for areas too far outside the viewport,
|
||||||
// but also don't trigger reflows every time the viewport changes.
|
// but also don't trigger reflows every time the viewport changes.
|
||||||
static VIEWPORT_EXPANSION: f32 = 2.0; // 2 lengths on each side plus original length is 5 total.
|
static VIEWPORT_EXPANSION: f32 = 2.0; // 2 lengths on each side plus original length is 5 total.
|
||||||
let proposed_clip_rect = geometry::f32_rect_to_au_rect(
|
let proposed_clip_rect = f32_rect_to_au_rect(
|
||||||
viewport.inflate(viewport.size.width * VIEWPORT_EXPANSION,
|
viewport.inflate(viewport.size.width * VIEWPORT_EXPANSION,
|
||||||
viewport.size.height * VIEWPORT_EXPANSION));
|
viewport.size.height * VIEWPORT_EXPANSION));
|
||||||
let clip_rect = self.page_clip_rect.get();
|
let clip_rect = self.page_clip_rect.get();
|
||||||
|
|
|
@ -53,6 +53,7 @@ use net_traits::request::{CredentialsMode, Destination, RequestInit, RequestMode
|
||||||
use net_traits::trim_http_whitespace;
|
use net_traits::trim_http_whitespace;
|
||||||
use network_listener::{NetworkListener, PreInvoke};
|
use network_listener::{NetworkListener, PreInvoke};
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
|
@ -64,7 +65,6 @@ use task_source::networking::NetworkingTaskSource;
|
||||||
use time;
|
use time;
|
||||||
use timers::{OneshotTimerCallback, OneshotTimerHandle};
|
use timers::{OneshotTimerCallback, OneshotTimerHandle};
|
||||||
use url::Position;
|
use url::Position;
|
||||||
use util::prefs::PREFS;
|
|
||||||
|
|
||||||
#[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf)]
|
#[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf)]
|
||||||
enum XMLHttpRequestState {
|
enum XMLHttpRequestState {
|
||||||
|
|
|
@ -83,6 +83,8 @@ extern crate script_traits;
|
||||||
extern crate selectors;
|
extern crate selectors;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
#[macro_use] extern crate servo_atoms;
|
#[macro_use] extern crate servo_atoms;
|
||||||
|
#[macro_use] extern crate servo_config;
|
||||||
|
extern crate servo_geometry;
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
extern crate smallvec;
|
extern crate smallvec;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -93,7 +95,6 @@ extern crate time;
|
||||||
extern crate tinyfiledialogs;
|
extern crate tinyfiledialogs;
|
||||||
extern crate url;
|
extern crate url;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate util;
|
|
||||||
extern crate uuid;
|
extern crate uuid;
|
||||||
extern crate webrender_traits;
|
extern crate webrender_traits;
|
||||||
extern crate websocket;
|
extern crate websocket;
|
||||||
|
|
|
@ -25,6 +25,8 @@ use js::rust::Runtime;
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use profile_traits::mem::{Report, ReportKind, ReportsChan};
|
use profile_traits::mem::{Report, ReportKind, ReportsChan};
|
||||||
use script_thread::{Runnable, STACK_ROOTS, trace_thread};
|
use script_thread::{Runnable, STACK_ROOTS, trace_thread};
|
||||||
|
use servo_config::opts;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::io::{Write, stdout};
|
use std::io::{Write, stdout};
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
@ -35,8 +37,6 @@ use std::ptr;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use style::thread_state;
|
use style::thread_state;
|
||||||
use time::{Tm, now};
|
use time::{Tm, now};
|
||||||
use util::opts;
|
|
||||||
use util::prefs::PREFS;
|
|
||||||
|
|
||||||
/// Common messages used to control the event loops in both the script and the worker
|
/// Common messages used to control the event loops in both the script and the worker
|
||||||
pub enum CommonScriptMsg {
|
pub enum CommonScriptMsg {
|
||||||
|
|
|
@ -91,6 +91,7 @@ use script_traits::CompositorEvent::{KeyEvent, MouseButtonEvent, MouseMoveEvent,
|
||||||
use script_traits::CompositorEvent::{TouchEvent, TouchpadPressureEvent};
|
use script_traits::CompositorEvent::{TouchEvent, TouchpadPressureEvent};
|
||||||
use script_traits::webdriver_msg::WebDriverScriptCommand;
|
use script_traits::webdriver_msg::WebDriverScriptCommand;
|
||||||
use serviceworkerjob::{Job, JobQueue, AsyncJobHandler, FinishJobHandler, InvokeType, SettleType};
|
use serviceworkerjob::{Job, JobQueue, AsyncJobHandler, FinishJobHandler, InvokeType, SettleType};
|
||||||
|
use servo_config::opts;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::collections::{hash_map, HashMap, HashSet};
|
use std::collections::{hash_map, HashMap, HashSet};
|
||||||
|
@ -101,6 +102,7 @@ use std::result::Result;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::mpsc::{Receiver, Select, Sender, channel};
|
use std::sync::mpsc::{Receiver, Select, Sender, channel};
|
||||||
|
use std::thread;
|
||||||
use style::context::ReflowGoal;
|
use style::context::ReflowGoal;
|
||||||
use style::dom::{TNode, UnsafeNode};
|
use style::dom::{TNode, UnsafeNode};
|
||||||
use style::thread_state;
|
use style::thread_state;
|
||||||
|
@ -112,8 +114,6 @@ use task_source::networking::NetworkingTaskSource;
|
||||||
use task_source::user_interaction::{UserInteractionTask, UserInteractionTaskSource};
|
use task_source::user_interaction::{UserInteractionTask, UserInteractionTaskSource};
|
||||||
use time::Tm;
|
use time::Tm;
|
||||||
use url::Position;
|
use url::Position;
|
||||||
use util::opts;
|
|
||||||
use util::thread;
|
|
||||||
use webdriver_handlers;
|
use webdriver_handlers;
|
||||||
|
|
||||||
thread_local!(pub static STACK_ROOTS: Cell<Option<RootCollectionPtr>> = Cell::new(None));
|
thread_local!(pub static STACK_ROOTS: Cell<Option<RootCollectionPtr>> = Cell::new(None));
|
||||||
|
@ -519,8 +519,7 @@ impl ScriptThreadFactory for ScriptThread {
|
||||||
|
|
||||||
let (sender, receiver) = channel();
|
let (sender, receiver) = channel();
|
||||||
let layout_chan = sender.clone();
|
let layout_chan = sender.clone();
|
||||||
thread::spawn_named(format!("ScriptThread {:?}", state.id),
|
thread::Builder::new().name(format!("ScriptThread {:?}", state.id)).spawn(move || {
|
||||||
move || {
|
|
||||||
thread_state::initialize(thread_state::SCRIPT);
|
thread_state::initialize(thread_state::SCRIPT);
|
||||||
PipelineNamespace::install(state.pipeline_namespace_id);
|
PipelineNamespace::install(state.pipeline_namespace_id);
|
||||||
FrameId::install(state.top_level_frame_id);
|
FrameId::install(state.top_level_frame_id);
|
||||||
|
@ -553,7 +552,7 @@ impl ScriptThreadFactory for ScriptThread {
|
||||||
|
|
||||||
// This must always be the very last operation performed before the thread completes
|
// This must always be the very last operation performed before the thread completes
|
||||||
failsafe.neuter();
|
failsafe.neuter();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
|
|
||||||
(sender, receiver)
|
(sender, receiver)
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,11 +16,11 @@ use ipc_channel::ipc::{self, IpcSender};
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use net_traits::{CustomResponseMediator, CoreResourceMsg};
|
use net_traits::{CustomResponseMediator, CoreResourceMsg};
|
||||||
use script_traits::{ServiceWorkerMsg, ScopeThings, SWManagerMsg, SWManagerSenders, DOMMessage};
|
use script_traits::{ServiceWorkerMsg, ScopeThings, SWManagerMsg, SWManagerSenders, DOMMessage};
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::mpsc::{channel, Sender, Receiver, RecvError};
|
use std::sync::mpsc::{channel, Sender, Receiver, RecvError};
|
||||||
use util::prefs::PREFS;
|
use std::thread;
|
||||||
use util::thread::spawn_named;
|
|
||||||
|
|
||||||
enum Message {
|
enum Message {
|
||||||
FromResource(CustomResponseMediator),
|
FromResource(CustomResponseMediator),
|
||||||
|
@ -60,11 +60,11 @@ impl ServiceWorkerManager {
|
||||||
let resource_port = ROUTER.route_ipc_receiver_to_new_mpsc_receiver(resource_port);
|
let resource_port = ROUTER.route_ipc_receiver_to_new_mpsc_receiver(resource_port);
|
||||||
let _ = sw_senders.resource_sender.send(CoreResourceMsg::NetworkMediator(resource_chan));
|
let _ = sw_senders.resource_sender.send(CoreResourceMsg::NetworkMediator(resource_chan));
|
||||||
let _ = sw_senders.swmanager_sender.send(SWManagerMsg::OwnSender(own_sender.clone()));
|
let _ = sw_senders.swmanager_sender.send(SWManagerMsg::OwnSender(own_sender.clone()));
|
||||||
spawn_named("ServiceWorkerManager".to_owned(), move || {
|
thread::Builder::new().name("ServiceWorkerManager".to_owned()).spawn(move || {
|
||||||
ServiceWorkerManager::new(own_sender,
|
ServiceWorkerManager::new(own_sender,
|
||||||
from_constellation,
|
from_constellation,
|
||||||
resource_port).handle_message();
|
resource_port).handle_message();
|
||||||
});
|
}).expect("Thread spawning failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_matching_scope(&self, load_url: &ServoUrl) -> Option<ServoUrl> {
|
pub fn get_matching_scope(&self, load_url: &ServoUrl) -> Option<ServoUrl> {
|
||||||
|
|
|
@ -18,12 +18,12 @@ use js::jsapi::{HandleValue, Heap};
|
||||||
use js::jsval::{JSVal, UndefinedValue};
|
use js::jsval::{JSVal, UndefinedValue};
|
||||||
use script_traits::{MsDuration, precise_time_ms};
|
use script_traits::{MsDuration, precise_time_ms};
|
||||||
use script_traits::{TimerEvent, TimerEventId, TimerEventRequest, TimerSource};
|
use script_traits::{TimerEvent, TimerEventId, TimerEventRequest, TimerSource};
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::cmp::{self, Ord, Ordering};
|
use std::cmp::{self, Ord, Ordering};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use util::prefs::PREFS;
|
|
||||||
|
|
||||||
#[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord, Debug)]
|
#[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord, Debug)]
|
||||||
pub struct OneshotTimerHandle(i32);
|
pub struct OneshotTimerHandle(i32);
|
||||||
|
|
|
@ -50,10 +50,10 @@ profile_traits = {path = "../profile_traits"}
|
||||||
script = {path = "../script"}
|
script = {path = "../script"}
|
||||||
script_layout_interface = {path = "../script_layout_interface"}
|
script_layout_interface = {path = "../script_layout_interface"}
|
||||||
script_traits = {path = "../script_traits"}
|
script_traits = {path = "../script_traits"}
|
||||||
|
servo_config = {path = "../config"}
|
||||||
servo_url = {path = "../url"}
|
servo_url = {path = "../url"}
|
||||||
style = {path = "../style", features = ["servo"]}
|
style = {path = "../style", features = ["servo"]}
|
||||||
url = "1.2"
|
url = "1.2"
|
||||||
util = {path = "../util"}
|
|
||||||
webdriver_server = {path = "../webdriver_server", optional = true}
|
webdriver_server = {path = "../webdriver_server", optional = true}
|
||||||
|
|
||||||
[dependencies.webrender]
|
[dependencies.webrender]
|
||||||
|
|
|
@ -45,10 +45,9 @@ pub extern crate profile_traits;
|
||||||
pub extern crate script;
|
pub extern crate script;
|
||||||
pub extern crate script_traits;
|
pub extern crate script_traits;
|
||||||
pub extern crate script_layout_interface;
|
pub extern crate script_layout_interface;
|
||||||
|
pub extern crate servo_config;
|
||||||
pub extern crate servo_url;
|
pub extern crate servo_url;
|
||||||
pub extern crate style;
|
pub extern crate style;
|
||||||
pub extern crate url;
|
|
||||||
pub extern crate util;
|
|
||||||
|
|
||||||
#[cfg(feature = "webdriver")]
|
#[cfg(feature = "webdriver")]
|
||||||
extern crate webdriver_server;
|
extern crate webdriver_server;
|
||||||
|
@ -88,17 +87,19 @@ use profile::time as profile_time;
|
||||||
use profile_traits::mem;
|
use profile_traits::mem;
|
||||||
use profile_traits::time;
|
use profile_traits::time;
|
||||||
use script_traits::{ConstellationMsg, SWManagerSenders, ScriptMsg};
|
use script_traits::{ConstellationMsg, SWManagerSenders, ScriptMsg};
|
||||||
|
use servo_config::opts;
|
||||||
|
use servo_config::prefs::PREFS;
|
||||||
|
use servo_config::resource_files::resources_dir_path;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::cmp::max;
|
use std::cmp::max;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::mpsc::Sender;
|
use std::sync::mpsc::Sender;
|
||||||
use util::opts;
|
|
||||||
use util::prefs::PREFS;
|
|
||||||
use util::resource_files::resources_dir_path;
|
|
||||||
|
|
||||||
pub use gleam::gl;
|
pub use gleam::gl;
|
||||||
|
pub use servo_config as config;
|
||||||
|
pub use servo_url as url;
|
||||||
|
|
||||||
/// The in-process interface to Servo.
|
/// The in-process interface to Servo.
|
||||||
///
|
///
|
||||||
|
|
|
@ -50,12 +50,12 @@ selectors = "0.15"
|
||||||
serde = {version = "0.8", optional = true}
|
serde = {version = "0.8", optional = true}
|
||||||
serde_derive = {version = "0.8", optional = true}
|
serde_derive = {version = "0.8", optional = true}
|
||||||
servo_atoms = {path = "../atoms", optional = true}
|
servo_atoms = {path = "../atoms", optional = true}
|
||||||
|
servo_config = {path = "../config"}
|
||||||
smallvec = "0.1"
|
smallvec = "0.1"
|
||||||
style_traits = {path = "../style_traits"}
|
style_traits = {path = "../style_traits"}
|
||||||
servo_url = {path = "../url"}
|
servo_url = {path = "../url"}
|
||||||
time = "0.1"
|
time = "0.1"
|
||||||
unicode-segmentation = "0.1.2"
|
unicode-segmentation = "0.1.2"
|
||||||
util = {path = "../util"}
|
|
||||||
plugins = {path = "../plugins", optional = true}
|
plugins = {path = "../plugins", optional = true}
|
||||||
|
|
||||||
[dependencies.num_cpus]
|
[dependencies.num_cpus]
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue