servo: Merge #10714 - Implement user interaction task source (from KiChjang:user-interaction-task); r=Ms2ger

Part of #7959.

Source-Repo: https://github.com/servo/servo
Source-Revision: 42141870e764d0763bfbbdbed70b74399ee342de
This commit is contained in:
Keith Yeung
2016-05-12 09:00:14 -07:00
parent ca65912b48
commit c2232eeea9
9 changed files with 88 additions and 66 deletions

View File

@@ -99,7 +99,7 @@ use task_source::dom_manipulation::{DOMManipulationTaskSource, DOMManipulationTa
use task_source::file_reading::FileReadingTaskSource;
use task_source::history_traversal::HistoryTraversalTaskSource;
use task_source::networking::NetworkingTaskSource;
use task_source::user_interaction::UserInteractionTaskSource;
use task_source::user_interaction::{UserInteractionTaskSource, UserInteractionTask};
use time::Tm;
use url::{Url, Position};
use util::opts;
@@ -222,6 +222,8 @@ pub enum MainThreadScriptMsg {
Navigate(PipelineId, LoadData),
/// Tasks that originate from the DOM manipulation task source
DOMManipulation(DOMManipulationTask),
/// Tasks that originate from the user interaction task source
UserInteraction(UserInteractionTask),
}
impl OpaqueSender<CommonScriptMsg> for Box<ScriptChan + Send> {
@@ -928,8 +930,10 @@ impl ScriptThread {
LiveDOMReferences::cleanup(addr),
MainThreadScriptMsg::Common(CommonScriptMsg::CollectReports(reports_chan)) =>
self.collect_reports(reports_chan),
MainThreadScriptMsg::DOMManipulation(msg) =>
msg.handle_msg(self),
MainThreadScriptMsg::DOMManipulation(task) =>
task.handle_task(self),
MainThreadScriptMsg::UserInteraction(task) =>
task.handle_task(),
}
}