Add the TaskSourceName to CommonScriptMsg::Task

Update QueuedTaskConversion and the TaskQueue to use it
This commit is contained in:
Agustin Chiappe Berrini 2018-09-02 08:18:22 -04:00 committed by AgustinCB
parent b211e45bb0
commit e286fdcc53
18 changed files with 134 additions and 71 deletions

View file

@ -2837,7 +2837,14 @@ impl Document {
let trusted_pending = Trusted::new(pending);
let trusted_promise = TrustedPromise::new(promise.clone());
let handler = ElementPerformFullscreenEnter::new(trusted_pending, trusted_promise, error);
let script_msg = CommonScriptMsg::Task(ScriptThreadEventCategory::EnterFullscreen, handler, pipeline_id);
// NOTE: This steps should be running in parallel
// https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen
let script_msg = CommonScriptMsg::Task(
ScriptThreadEventCategory::EnterFullscreen,
handler,
pipeline_id,
TaskSourceName::DOMManipulation,
);
let msg = MainThreadScriptMsg::Common(script_msg);
window.main_thread_script_chan().send(msg).unwrap();
@ -2870,7 +2877,14 @@ impl Document {
let trusted_promise = TrustedPromise::new(promise.clone());
let handler = ElementPerformFullscreenExit::new(trusted_element, trusted_promise);
let pipeline_id = Some(global.pipeline_id());
let script_msg = CommonScriptMsg::Task(ScriptThreadEventCategory::ExitFullscreen, handler, pipeline_id);
// NOTE: This steps should be running in parallel
// https://fullscreen.spec.whatwg.org/#exit-fullscreen
let script_msg = CommonScriptMsg::Task(
ScriptThreadEventCategory::ExitFullscreen,
handler,
pipeline_id,
TaskSourceName::DOMManipulation,
);
let msg = MainThreadScriptMsg::Common(script_msg);
window.main_thread_script_chan().send(msg).unwrap();