Commit graph

37 commits

Author SHA1 Message Date
Martin Robinson
3398fc017b
Move non-gfx things out of gfx_traits and create a base crate (#32296)
For a long time, `gfx_traits` has held a lot of things unrelated to graphics
and also unrelated to the `gfx` crate (which is mostly about fonts).
This is a cleanup which does a few things:

1. Move non `gfx` crate things out of `gfx_traits`. This is important in
   order to prevent dependency cycles with a different integration between
   layout, script, and fonts.
2. Rename the `msg` crate to `base`. It didn't really contain anything
   to do with messages and instead mostly holds ids, which are used
   across many different crates in Servo. This new crate will hold the
   *rare* data types that are widely used.

Details:

 - All BackgroundHangMonitor-related things from base to a new
   `background_hang_monitor_api` crate.
 - Moved `TraversalDirection` to `script_traits`
 - Moved `Epoch`-related things from `gfx_traits` to `base`.
 - Moved `PrintTree` to base. This should be widely useful in Servo.
 - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it
   to `WebRenderFontApi`.
2024-05-17 12:28:58 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
9514f670d1
No tracing of nop traceable fields (#29926)
* Add `no_trace` option to JSTraceable derive

* NoTrace wrapper

* Port some types to no_trace schematics

* Fixing my unsafe mistakes (not tracing traceables)

* Add docs & safety guards for no_trace

Safety guards (trait shenanigans) guarantees safety usage of `no_trace`

* Port canvas_traits to no_trace

* Port servo_media to no_trace

* Port net_traits to no_trace

* Port style to no_trace

* Port webgpu to no_trace

* Port script_traits to no_trace

* Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace

* unrooted_must_root lint in seperate file

* Add trace_in_no_trace_lint as script_plugin

* Composable types in must_not_have_traceable

* Introduced HashMapTracedValues wrapper

* `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>`

* Port rest of servo's types to no_trace

* Port html5ever, euclid, mime and http to no_trace

* Port remaining externals to no_trace

* Port webxr and Arc<Mutex<_>>

* Fix spelling in notrace doc
2023-08-04 10:17:43 +00:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Bastien Orivel
9a7eeb349a Update crossbeam-channel to 0.3 2018-11-18 19:33:19 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Simon Sapin
2a996fbc8f Replace mpsc with crossbeam/servo channel, update ipc-channel
Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
2018-09-12 13:33:32 +08:00
Agustin Chiappe Berrini
e286fdcc53 Add the TaskSourceName to CommonScriptMsg::Task
Update QueuedTaskConversion and the TaskQueue to use it
2018-09-04 09:17:11 -04:00
Gregory Terzian
671627e97e introduce "per task source" ignoring of tasks 2018-07-10 13:42:28 +08:00
ddh
52b63def44 added pipelines to all task sources
changed task sources to accept pipeline ids
2017-10-25 14:25:58 +01:00
ddh
2ffbe53989 added time to interactive metrics, refactored metrics to use traits
changed task macro to take pipeline info
2017-10-24 21:02:56 +01:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
Anthony Ramine
6c9fb5ae7a Introduce TaskOnce
Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing
from CancellableTask<T>.
2017-09-20 10:37:09 +02:00
Anthony Ramine
52527d6f9d Rename Task to TaskBox 2017-09-20 10:07:29 +02:00
Anthony Ramine
f088b708c9 Make Task require Send 2017-09-20 09:40:53 +02:00
Anthony Ramine
46628fba05 Move Task to its own module 2017-09-18 02:47:04 +02:00
Anthony Ramine
56117d3185 Rename Runnable to Task
The changes are:
 * `*Runnable` -> `*Task`;
 * `RunnableMsg` -> `Task`;
 * `RunnableWrapper` -> `TaskCanceller`;
 * `MainThreadRunnable` -> `MainThreadTask`;
 * `wrap_runnable` -> `wrap_task`;
 * `get_runnable_wrapper` -> `task_canceller`;
 * `handler` -> `run`;
 * `main_thread_handler` -> `run_with_script_thread`.
2017-09-16 15:43:26 +02:00
Anthony Ramine
53d30d85b3 Reformat some task-related functions 2017-09-08 10:19:06 +02:00
Anthony Ramine
35a7252254 Kill UserInteractionTask
Just use a bare Runnable value.
2017-09-08 10:17:23 +02:00
Anthony Ramine
17a1dd9385 Kill Runnable::is_cancelled ⚔️ 2017-09-07 14:54:03 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Alan Jeffrey
a47e94c8f6 Added Debug implementations. 2017-06-13 10:46:59 -05:00
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Anthony Ramine
44ca9f3d71 Make TaskSource::queue take a &GlobalScope 2016-10-06 21:35:52 +02:00
Josh Matthews
2aef518ce6 Make task queue API usable from non-main threads. 2016-07-14 13:27:41 -04:00
Connor Brewster
ad30275d04 Move boxing to runnable initialization 2016-07-13 11:10:23 -06:00
Connor Brewster
5f7324a9a5 Make all task source runnables cancellable
Implement all Runnable methods on CancellableRunnable to redirect to their inner runnable
2016-07-13 09:59:51 -06:00
Connor Brewster
afc0ccb48d Add event runnables
Make tasks a wrapper over runnables
2016-07-11 22:21:45 -06:00
Ms2ger
0861b701d5 Derive Clone for DOMManipulationTaskSource, UserInteractionTaskSource. 2016-06-03 09:33:18 +02:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Keith Yeung
cc049515dc Implement user interaction task source 2016-05-11 10:12:25 -04:00
Rahul Sharma
2caa9a2a76 refactors entities from script_thread into script_runtime 2016-04-06 12:46:49 +05:30
faineance
7c45a4fea0 change changes effecting verbosity 2016-03-27 13:54:41 +01:00
faineance
418842faf9 use self.0 instead of destructing single item tuple structs 2016-03-27 11:50:08 +01:00
Keith Yeung
3f2cbf0025 Add task_source directory
Use DOMManipulationTaskSource whenever possible
2016-03-10 01:05:53 -05:00