mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #11239 - jdm:time-profile, r=nox
Add timeline markers for HTTP requests, JS evaluation, and HTML parsing. Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: - [ ] `./mach build -d` does not report any errors (didn't try to compile past a rustc upgrade on airplane wifi) - [X] `./mach test-tidy --faster` does not report any errors - [X] These changes fix #11218 (github issue number if applicable). Either: - [ ] There are tests for these changes OR - [X] These changes do not require tests because we don't have testing infrastructure for profiling. Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11239) <!-- Reviewable:end -->
This commit is contained in:
commit
96a86bd952
19 changed files with 126 additions and 30 deletions
|
@ -23,7 +23,7 @@ use js::jsval::UndefinedValue;
|
|||
use js::rust::Runtime;
|
||||
use msg::constellation_msg::{ConstellationChan, PanicMsg, PipelineId};
|
||||
use net_traits::{LoadContext, ResourceThread, load_whole_resource};
|
||||
use profile_traits::mem;
|
||||
use profile_traits::{mem, time};
|
||||
use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort};
|
||||
use script_traits::ScriptMsg as ConstellationMsg;
|
||||
use script_traits::{MsDuration, TimerEvent, TimerEventId, TimerEventRequest, TimerSource};
|
||||
|
@ -45,6 +45,7 @@ pub enum WorkerGlobalScopeTypeId {
|
|||
pub struct WorkerGlobalScopeInit {
|
||||
pub resource_thread: ResourceThread,
|
||||
pub mem_profiler_chan: mem::ProfilerChan,
|
||||
pub time_profiler_chan: time::ProfilerChan,
|
||||
pub to_devtools_sender: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
|
||||
pub from_devtools_sender: Option<IpcSender<DevtoolScriptControlMsg>>,
|
||||
pub constellation_chan: ConstellationChan<ConstellationMsg>,
|
||||
|
@ -73,6 +74,8 @@ pub struct WorkerGlobalScope {
|
|||
timers: OneshotTimers,
|
||||
#[ignore_heap_size_of = "Defined in std"]
|
||||
mem_profiler_chan: mem::ProfilerChan,
|
||||
#[ignore_heap_size_of = "Defined in std"]
|
||||
time_profiler_chan: time::ProfilerChan,
|
||||
#[ignore_heap_size_of = "Defined in ipc-channel"]
|
||||
to_devtools_sender: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
|
||||
|
||||
|
@ -122,6 +125,7 @@ impl WorkerGlobalScope {
|
|||
crypto: Default::default(),
|
||||
timers: OneshotTimers::new(timer_event_chan, init.scheduler_chan.clone()),
|
||||
mem_profiler_chan: init.mem_profiler_chan,
|
||||
time_profiler_chan: init.time_profiler_chan,
|
||||
to_devtools_sender: init.to_devtools_sender,
|
||||
from_devtools_sender: init.from_devtools_sender,
|
||||
from_devtools_receiver: from_devtools_receiver,
|
||||
|
@ -136,6 +140,10 @@ impl WorkerGlobalScope {
|
|||
&self.mem_profiler_chan
|
||||
}
|
||||
|
||||
pub fn time_profiler_chan(&self) -> &time::ProfilerChan {
|
||||
&self.time_profiler_chan
|
||||
}
|
||||
|
||||
pub fn devtools_chan(&self) -> Option<IpcSender<ScriptToDevtoolsControlMsg>> {
|
||||
self.to_devtools_sender.clone()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue