mirror of
https://github.com/servo/servo.git
synced 2025-07-28 17:50:37 +01:00
Move thread_state to style.
This commit is contained in:
parent
32a0493cde
commit
307d1ced3c
14 changed files with 14 additions and 14 deletions
|
@ -29,11 +29,11 @@ use std::collections::HashMap;
|
||||||
use std::mem as std_mem;
|
use std::mem as 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 style::thread_state;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use util::geometry::ExpandToPixelBoundaries;
|
use util::geometry::ExpandToPixelBoundaries;
|
||||||
use util::opts;
|
use util::opts;
|
||||||
use util::thread;
|
use util::thread;
|
||||||
use util::thread_state;
|
|
||||||
|
|
||||||
#[derive(Clone, HeapSizeOf)]
|
#[derive(Clone, HeapSizeOf)]
|
||||||
struct PaintLayer {
|
struct PaintLayer {
|
||||||
|
|
|
@ -110,6 +110,7 @@ use style::refcell::RefCell;
|
||||||
use style::selector_matching::Stylist;
|
use style::selector_matching::Stylist;
|
||||||
use style::servo_selector_impl::USER_OR_USER_AGENT_STYLESHEETS;
|
use style::servo_selector_impl::USER_OR_USER_AGENT_STYLESHEETS;
|
||||||
use style::stylesheets::{Stylesheet, CSSRuleIteratorExt};
|
use style::stylesheets::{Stylesheet, CSSRuleIteratorExt};
|
||||||
|
use style::thread_state;
|
||||||
use style::timer::Timer;
|
use style::timer::Timer;
|
||||||
use style::workqueue::WorkQueue;
|
use style::workqueue::WorkQueue;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
@ -118,7 +119,6 @@ use util::ipc::OptionalIpcSender;
|
||||||
use util::opts;
|
use util::opts;
|
||||||
use util::prefs::PREFS;
|
use util::prefs::PREFS;
|
||||||
use util::thread;
|
use util::thread;
|
||||||
use util::thread_state;
|
|
||||||
|
|
||||||
/// The number of screens we have to traverse before we decide to generate new display lists.
|
/// The number of screens we have to traverse before we decide to generate new display lists.
|
||||||
const DISPLAY_PORT_THRESHOLD_SIZE_FACTOR: i32 = 4;
|
const DISPLAY_PORT_THRESHOLD_SIZE_FACTOR: i32 = 4;
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
use dom::bindings::trace::JSTraceable;
|
use dom::bindings::trace::JSTraceable;
|
||||||
use js::jsapi::JSTracer;
|
use js::jsapi::JSTracer;
|
||||||
use std::cell::{BorrowError, BorrowMutError, Ref, RefCell, RefMut};
|
use std::cell::{BorrowError, BorrowMutError, Ref, RefCell, RefMut};
|
||||||
use util::thread_state;
|
use style::thread_state;
|
||||||
use util::thread_state::SCRIPT;
|
use style::thread_state::SCRIPT;
|
||||||
|
|
||||||
/// A mutable field in the DOM.
|
/// A mutable field in the DOM.
|
||||||
///
|
///
|
||||||
|
|
|
@ -43,7 +43,7 @@ use std::intrinsics::type_name;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use util::thread_state;
|
use style::thread_state;
|
||||||
|
|
||||||
/// A traced reference to a DOM object
|
/// A traced reference to a DOM object
|
||||||
///
|
///
|
||||||
|
|
|
@ -37,9 +37,9 @@ use std::mem::replace;
|
||||||
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::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
use style::thread_state;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use util::thread::spawn_named;
|
use util::thread::spawn_named;
|
||||||
use util::thread_state;
|
|
||||||
|
|
||||||
/// 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
|
||||||
|
|
|
@ -76,8 +76,8 @@ use std::ops::Range;
|
||||||
use string_cache::{Atom, Namespace, QualName};
|
use string_cache::{Atom, Namespace, QualName};
|
||||||
use style::dom::OpaqueNode;
|
use style::dom::OpaqueNode;
|
||||||
use style::selector_impl::ServoSelectorImpl;
|
use style::selector_impl::ServoSelectorImpl;
|
||||||
|
use style::thread_state;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use util::thread_state;
|
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -32,11 +32,11 @@ use script_traits::{TimerEvent, WorkerGlobalScopeInit, ScopeThings, ServiceWorke
|
||||||
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;
|
||||||
|
use style::thread_state::{IN_WORKER, SCRIPT};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use util::prefs::PREFS;
|
use util::prefs::PREFS;
|
||||||
use util::thread::spawn_named;
|
use util::thread::spawn_named;
|
||||||
use util::thread_state;
|
|
||||||
use util::thread_state::{IN_WORKER, SCRIPT};
|
|
||||||
|
|
||||||
/// Messages used to control service worker event loop
|
/// Messages used to control service worker event loop
|
||||||
pub enum ServiceWorkerScriptMsg {
|
pub enum ServiceWorkerScriptMsg {
|
||||||
|
|
|
@ -25,10 +25,10 @@ use std::io::{Write, stdout};
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::os;
|
use std::os;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
use style::thread_state;
|
||||||
use time::{Tm, now};
|
use time::{Tm, now};
|
||||||
use util::opts;
|
use util::opts;
|
||||||
use util::prefs::PREFS;
|
use util::prefs::PREFS;
|
||||||
use util::thread_state;
|
|
||||||
|
|
||||||
/// 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 {
|
||||||
|
|
|
@ -99,6 +99,7 @@ use std::sync::atomic::{Ordering, AtomicBool};
|
||||||
use std::sync::mpsc::{Receiver, Select, Sender, channel};
|
use std::sync::mpsc::{Receiver, Select, Sender, channel};
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use style::context::ReflowGoal;
|
use style::context::ReflowGoal;
|
||||||
|
use style::thread_state;
|
||||||
use task_source::TaskSource;
|
use task_source::TaskSource;
|
||||||
use task_source::dom_manipulation::{DOMManipulationTaskSource, DOMManipulationTask};
|
use task_source::dom_manipulation::{DOMManipulationTaskSource, DOMManipulationTask};
|
||||||
use task_source::file_reading::FileReadingTaskSource;
|
use task_source::file_reading::FileReadingTaskSource;
|
||||||
|
@ -109,7 +110,6 @@ use time::Tm;
|
||||||
use url::{Url, Position};
|
use url::{Url, Position};
|
||||||
use util::opts;
|
use util::opts;
|
||||||
use util::thread;
|
use util::thread;
|
||||||
use util::thread_state;
|
|
||||||
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));
|
||||||
|
|
|
@ -101,6 +101,7 @@ pub mod sequential;
|
||||||
pub mod sink;
|
pub mod sink;
|
||||||
pub mod str;
|
pub mod str;
|
||||||
pub mod stylesheets;
|
pub mod stylesheets;
|
||||||
|
pub mod thread_state;
|
||||||
mod tid;
|
mod tid;
|
||||||
pub mod timer;
|
pub mod timer;
|
||||||
pub mod traversal;
|
pub mod traversal;
|
||||||
|
|
|
@ -18,8 +18,8 @@ use deque::{self, Abort, Data, Empty, Stealer, Worker};
|
||||||
use rand::{Rng, XorShiftRng, weak_rng};
|
use rand::{Rng, XorShiftRng, weak_rng};
|
||||||
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 thread_state;
|
||||||
use util::thread::spawn_named;
|
use util::thread::spawn_named;
|
||||||
use util::thread_state;
|
|
||||||
|
|
||||||
/// A unit of work.
|
/// A unit of work.
|
||||||
///
|
///
|
||||||
|
|
|
@ -35,7 +35,6 @@ pub mod prefs;
|
||||||
#[cfg(feature = "servo")] pub mod remutex;
|
#[cfg(feature = "servo")] pub mod remutex;
|
||||||
pub mod resource_files;
|
pub mod resource_files;
|
||||||
pub mod thread;
|
pub mod thread;
|
||||||
pub mod thread_state;
|
|
||||||
|
|
||||||
pub fn servo_version() -> &'static str {
|
pub fn servo_version() -> &'static str {
|
||||||
concat!("Servo ", env!("CARGO_PKG_VERSION"), env!("GIT_INFO"))
|
concat!("Servo ", env!("CARGO_PKG_VERSION"), env!("GIT_INFO"))
|
||||||
|
|
|
@ -17,9 +17,9 @@ use style::media_queries::{Device, MediaType};
|
||||||
use style::parallel::WorkQueueData;
|
use style::parallel::WorkQueueData;
|
||||||
use style::selector_matching::Stylist;
|
use style::selector_matching::Stylist;
|
||||||
use style::stylesheets::Stylesheet;
|
use style::stylesheets::Stylesheet;
|
||||||
|
use style::thread_state;
|
||||||
use style::workqueue::WorkQueue;
|
use style::workqueue::WorkQueue;
|
||||||
use style_traits::ViewportPx;
|
use style_traits::ViewportPx;
|
||||||
use util::thread_state;
|
|
||||||
|
|
||||||
pub struct PerDocumentStyleData {
|
pub struct PerDocumentStyleData {
|
||||||
/// Rule processor.
|
/// Rule processor.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue