diff options
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index b4363f5ada3..fac11949d70 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -81,6 +81,7 @@ use crate::task_source::history_traversal::HistoryTraversalTaskSource; use crate::task_source::media_element::MediaElementTaskSource; use crate::task_source::networking::NetworkingTaskSource; use crate::task_source::performance_timeline::PerformanceTimelineTaskSource; +use crate::task_source::port_message::PortMessageQueue; use crate::task_source::remote_event::RemoteEventTaskSource; use crate::task_source::user_interaction::UserInteractionTaskSource; use crate::task_source::websocket::WebsocketTaskSource; @@ -566,6 +567,8 @@ pub struct ScriptThread { performance_timeline_task_sender: Box<dyn ScriptChan>, + port_message_sender: Box<dyn ScriptChan>, + remote_event_task_sender: Box<dyn ScriptChan>, /// A channel to hand out to threads that need to respond to a message from the script thread. @@ -1296,6 +1299,7 @@ impl ScriptThread { media_element_task_sender: chan.clone(), user_interaction_task_sender: chan.clone(), networking_task_sender: boxed_script_sender.clone(), + port_message_sender: boxed_script_sender.clone(), file_reading_task_sender: boxed_script_sender.clone(), performance_timeline_task_sender: boxed_script_sender.clone(), remote_event_task_sender: boxed_script_sender.clone(), @@ -1656,6 +1660,7 @@ impl ScriptThread { ScriptThreadEventCategory::PerformanceTimelineTask => { ScriptHangAnnotation::PerformanceTimelineTask }, + ScriptThreadEventCategory::PortMessage => ScriptHangAnnotation::PortMessage, }; self.background_hang_monitor .notify_activity(HangAnnotation::Script(hang_annotation)); @@ -1756,6 +1761,7 @@ impl ScriptThread { ScriptThreadEventCategory::ImageCacheMsg => ProfilerCategory::ScriptImageCacheMsg, ScriptThreadEventCategory::InputEvent => ProfilerCategory::ScriptInputEvent, ScriptThreadEventCategory::NetworkEvent => ProfilerCategory::ScriptNetworkEvent, + ScriptThreadEventCategory::PortMessage => ProfilerCategory::ScriptPortMessage, ScriptThreadEventCategory::Resize => ProfilerCategory::ScriptResize, ScriptThreadEventCategory::ScriptEvent => ProfilerCategory::ScriptEvent, ScriptThreadEventCategory::SetScrollState => ProfilerCategory::ScriptSetScrollState, @@ -2780,6 +2786,10 @@ impl ScriptThread { NetworkingTaskSource(self.networking_task_sender.clone(), pipeline_id) } + pub fn port_message_queue(&self, pipeline_id: PipelineId) -> PortMessageQueue { + PortMessageQueue(self.port_message_sender.clone(), pipeline_id) + } + pub fn file_reading_task_source(&self, pipeline_id: PipelineId) -> FileReadingTaskSource { FileReadingTaskSource(self.file_reading_task_sender.clone(), pipeline_id) } @@ -3177,6 +3187,7 @@ impl ScriptThread { self.networking_task_source(incomplete.pipeline_id), self.performance_timeline_task_source(incomplete.pipeline_id) .clone(), + self.port_message_queue(incomplete.pipeline_id), self.user_interaction_task_source(incomplete.pipeline_id), self.remote_event_task_source(incomplete.pipeline_id), self.websocket_task_source(incomplete.pipeline_id), |