diff options
author | Gregory Terzian <gterzian@users.noreply.github.com> | 2019-06-26 00:25:48 +0800 |
---|---|---|
committer | Gregory Terzian <gterzian@users.noreply.github.com> | 2019-10-19 14:28:18 +0800 |
commit | 2f8932a6a1e2666567435114383b3acd1899aca7 (patch) | |
tree | 8490d198d1c22015afeae84ad25f21ecca462415 /components/script/script_thread.rs | |
parent | c3b17c1201441c9a24c4b272108aea0196fbf1b9 (diff) | |
download | servo-2f8932a6a1e2666567435114383b3acd1899aca7.tar.gz servo-2f8932a6a1e2666567435114383b3acd1899aca7.zip |
continue messageport, transferable, postmessage options
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index fac11949d70..6a7a69651e7 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -38,7 +38,6 @@ use crate::dom::bindings::reflector::DomObject; use crate::dom::bindings::root::ThreadLocalStackRoots; use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom, RootCollection}; use crate::dom::bindings::str::DOMString; -use crate::dom::bindings::structuredclone::StructuredCloneData; use crate::dom::bindings::trace::JSTraceable; use crate::dom::bindings::utils::WRAP_CALLBACKS; use crate::dom::customelementregistry::{ @@ -133,6 +132,7 @@ use script_traits::CompositorEvent::{ CompositionEvent, KeyboardEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent, TouchEvent, WheelEvent, }; +use script_traits::StructuredSerializedData; use script_traits::{CompositorEvent, ConstellationControlMsg}; use script_traits::{ DiscardBrowsingContext, DocumentActivity, EventResult, HistoryEntryReplacement, @@ -1589,6 +1589,11 @@ impl ScriptThread { continue; } let window = document.window(); + + window + .upcast::<GlobalScope>() + .perform_a_message_port_garbage_collection_checkpoint(); + let pending_reflows = window.get_pending_reflow_count(); if pending_reflows > 0 { window.reflow(ReflowGoal::Full, ReflowReason::ImageLoaded); @@ -1867,12 +1872,14 @@ impl ScriptThread { source: source_pipeline_id, source_browsing_context, target_origin: origin, + source_origin, data, } => self.handle_post_message_msg( target_pipeline_id, source_pipeline_id, source_browsing_context, origin, + source_origin, data, ), ConstellationControlMsg::UpdatePipelineId( @@ -2525,7 +2532,8 @@ impl ScriptThread { source_pipeline_id: PipelineId, source_browsing_context: TopLevelBrowsingContextId, origin: Option<ImmutableOrigin>, - data: Vec<u8>, + source_origin: ImmutableOrigin, + data: StructuredSerializedData, ) { match { self.documents.borrow().find_window(pipeline_id) } { None => return warn!("postMessage after target pipeline {} closed.", pipeline_id), @@ -2547,7 +2555,7 @@ impl ScriptThread { Some(source) => source, }; // FIXME(#22512): enqueues a task; unnecessary delay. - window.post_message(origin, &*source, StructuredCloneData::Vector(data)) + window.post_message(origin, source_origin, &*source, data) }, } } |