Implement TaskSource for HistoryTraversal

And remove the method in window that returns it, because it isn't used
so far.
This commit is contained in:
Agustin Chiappe Berrini 2018-09-27 18:43:22 -04:00
parent b1a2b6b5bf
commit 14bc8ab754
6 changed files with 42 additions and 15 deletions

View file

@ -521,7 +521,7 @@ pub struct ScriptThread {
networking_task_sender: Box<dyn ScriptChan>,
history_traversal_task_source: HistoryTraversalTaskSource,
history_traversal_task_sender: Sender<MainThreadScriptMsg>,
file_reading_task_sender: Box<dyn ScriptChan>,
@ -1042,7 +1042,7 @@ impl ScriptThread {
performance_timeline_task_sender: boxed_script_sender.clone(),
remote_event_task_sender: boxed_script_sender.clone(),
history_traversal_task_source: HistoryTraversalTaskSource(chan),
history_traversal_task_sender: chan.clone(),
control_chan: state.control_chan,
control_port: control_port,
@ -1409,6 +1409,7 @@ impl ScriptThread {
ScriptThreadEventCategory::FormPlannedNavigation => {
ProfilerCategory::ScriptPlannedNavigation
},
ScriptThreadEventCategory::HistoryEvent => ProfilerCategory::ScriptHistoryEvent,
ScriptThreadEventCategory::ImageCacheMsg => ProfilerCategory::ScriptImageCacheMsg,
ScriptThreadEventCategory::InputEvent => ProfilerCategory::ScriptInputEvent,
ScriptThreadEventCategory::NetworkEvent => ProfilerCategory::ScriptNetworkEvent,
@ -2180,6 +2181,13 @@ impl ScriptThread {
PerformanceTimelineTaskSource(self.performance_timeline_task_sender.clone(), pipeline_id)
}
pub fn history_traversal_task_source(
&self,
pipeline_id: PipelineId,
) -> HistoryTraversalTaskSource {
HistoryTraversalTaskSource(self.history_traversal_task_sender.clone(), pipeline_id)
}
pub fn user_interaction_task_source(
&self,
pipeline_id: PipelineId,
@ -2560,7 +2568,6 @@ impl ScriptThread {
);
let MainThreadScriptChan(ref sender) = self.chan;
let HistoryTraversalTaskSource(ref history_sender) = self.history_traversal_task_source;
let (ipc_timer_event_chan, ipc_timer_event_port) = ipc::channel().unwrap();
route_ipc_receiver_to_new_servo_sender(ipc_timer_event_port, self.timer_event_chan.clone());
@ -2584,7 +2591,7 @@ impl ScriptThread {
self.media_element_task_source(incomplete.pipeline_id),
self.user_interaction_task_source(incomplete.pipeline_id),
self.networking_task_source(incomplete.pipeline_id),
HistoryTraversalTaskSource(history_sender.clone()),
self.history_traversal_task_source(incomplete.pipeline_id),
self.file_reading_task_source(incomplete.pipeline_id),
self.performance_timeline_task_source(incomplete.pipeline_id)
.clone(),