script

Struct ScriptThread

Source
pub struct ScriptThread {
Show 42 fields last_render_opportunity_time: DomRefCell<Option<Instant>>, documents: DomRefCell<DocumentCollection>, window_proxies: DomRefCell<HashMapTracedValues<BrowsingContextId, Dom<WindowProxy>>>, incomplete_loads: DomRefCell<Vec<InProgressLoad>>, incomplete_parser_contexts: IncompleteParserContexts, image_cache: Arc<dyn ImageCache>, receivers: ScriptThreadReceivers, senders: ScriptThreadSenders, resource_threads: ResourceThreads, task_queue: TaskQueue<MainThreadScriptMsg>, background_hang_monitor: Box<dyn BackgroundHangMonitor>, closing: Arc<AtomicBool>, timer_scheduler: RefCell<TimerScheduler>, system_font_service: Arc<SystemFontServiceProxy>, js_runtime: Rc<Runtime>, topmost_mouse_over_target: MutNullableDom<Element>, closed_pipelines: DomRefCell<HashSet<PipelineId>>, microtask_queue: Rc<MicrotaskQueue>, mutation_observer_microtask_queued: Cell<bool>, mutation_observers: DomRefCell<Vec<Dom<MutationObserver>>>, signal_slots: DomRefCell<Vec<Dom<HTMLSlotElement>>>, webgl_chan: Option<WebGLPipeline>, webxr_registry: Option<Registry>, worklet_thread_pool: DomRefCell<Option<Rc<WorkletThreadPool>>>, docs_with_no_blocking_loads: DomRefCell<HashSet<Dom<Document>>>, custom_element_reaction_stack: CustomElementReactionStack, webrender_document: DocumentId, compositor_api: CrossProcessCompositorApi, profile_script_events: bool, print_pwm: bool, relayout_event: bool, unminify_js: bool, local_script_source: Option<String>, unminify_css: bool, user_content_manager: UserContentManager, user_agent: Cow<'static, str>, player_context: WindowGLContext, node_ids: DomRefCell<HashSet<String>>, is_user_interacting: Cell<bool>, gpu_id_hub: Arc<IdentityHub>, inherited_secure_context: Option<bool>, layout_factory: Arc<dyn LayoutFactory>,
}

Fields§

§last_render_opportunity_time: DomRefCell<Option<Instant>>§documents: DomRefCell<DocumentCollection>

The documents for pipelines managed by this thread

§window_proxies: DomRefCell<HashMapTracedValues<BrowsingContextId, Dom<WindowProxy>>>

The window proxies known by this thread TODO: this map grows, but never shrinks. Issue #15258.

§incomplete_loads: DomRefCell<Vec<InProgressLoad>>

A list of data pertaining to loads that have not yet received a network response

§incomplete_parser_contexts: IncompleteParserContexts

A vector containing parser contexts which have not yet been fully processed

§image_cache: Arc<dyn ImageCache>

Image cache for this script thread.

§receivers: ScriptThreadReceivers

A ScriptThreadReceivers holding all of the incoming Receivers for messages to this ScriptThread.

§senders: ScriptThreadSenders

A ScriptThreadSenders that holds all outgoing sending channels necessary to communicate to other parts of Servo.

§resource_threads: ResourceThreads

A handle to the resource thread. This is an Arc to avoid running out of file descriptors if there are many iframes.

§task_queue: TaskQueue<MainThreadScriptMsg>

A queue of tasks to be executed in this script-thread.

§background_hang_monitor: Box<dyn BackgroundHangMonitor>

The dedicated means of communication with the background-hang-monitor for this script-thread.

§closing: Arc<AtomicBool>

A flag set to true by the BHM on exit, and checked from within the interrupt handler.

§timer_scheduler: RefCell<TimerScheduler>

A TimerScheduler used to schedule timers for this ScriptThread. Timers are handled in the ScriptThread event loop.

§system_font_service: Arc<SystemFontServiceProxy>

A proxy to the SystemFontService to use for accessing system font lists.

§js_runtime: Rc<Runtime>

The JavaScript runtime.

§topmost_mouse_over_target: MutNullableDom<Element>

The topmost element over the mouse.

§closed_pipelines: DomRefCell<HashSet<PipelineId>>

List of pipelines that have been owned and closed by this script thread.

§microtask_queue: Rc<MicrotaskQueue>§mutation_observer_microtask_queued: Cell<bool>

Microtask Queue for adding support for mutation observer microtasks

§mutation_observers: DomRefCell<Vec<Dom<MutationObserver>>>

The unit of related similar-origin browsing contexts’ list of MutationObserver objects

§signal_slots: DomRefCell<Vec<Dom<HTMLSlotElement>>>§webgl_chan: Option<WebGLPipeline>

A handle to the WebGL thread

§webxr_registry: Option<Registry>

The WebXR device registry

§worklet_thread_pool: DomRefCell<Option<Rc<WorkletThreadPool>>>

The worklet thread pool

§docs_with_no_blocking_loads: DomRefCell<HashSet<Dom<Document>>>

A list of pipelines containing documents that finished loading all their blocking resources during a turn of the event loop.

§custom_element_reaction_stack: CustomElementReactionStack§webrender_document: DocumentId

The Webrender Document ID associated with this thread.

§compositor_api: CrossProcessCompositorApi

Cross-process access to the compositor’s API.

§profile_script_events: bool

Periodically print out on which events script threads spend their processing time.

§print_pwm: bool

Print Progressive Web Metrics to console.

§relayout_event: bool

Emits notifications when there is a relayout.

§unminify_js: bool

Unminify Javascript.

§local_script_source: Option<String>

Directory with stored unminified scripts

§unminify_css: bool

Unminify Css.

§user_content_manager: UserContentManager

User content manager

§user_agent: Cow<'static, str>

An optional string allowing the user agent to be set for testing.

§player_context: WindowGLContext

Application window’s GL Context for Media player

§node_ids: DomRefCell<HashSet<String>>

A set of all nodes ever created in this script thread

§is_user_interacting: Cell<bool>

Code is running as a consequence of a user interaction

§gpu_id_hub: Arc<IdentityHub>

Identity manager for WebGPU resources

§inherited_secure_context: Option<bool>§layout_factory: Arc<dyn LayoutFactory>

A factory for making new layouts. This allows layout to depend on script.

Implementations§

Source§

impl ScriptThread

Source

pub(crate) fn runtime_handle() -> ParentRuntime

Source

pub(crate) fn can_continue_running() -> bool

Source

pub(crate) fn prepare_for_shutdown()

Source

pub(crate) fn set_mutation_observer_microtask_queued(value: bool)

Source

pub(crate) fn is_mutation_observer_microtask_queued() -> bool

Source

pub(crate) fn add_mutation_observer(observer: &MutationObserver)

Source

pub(crate) fn get_mutation_observers() -> Vec<DomRoot<MutationObserver>>

Source

pub(crate) fn add_signal_slot(observer: &HTMLSlotElement)

Source

pub(crate) fn take_signal_slots() -> Vec<DomRoot<HTMLSlotElement>>

Source

pub(crate) fn mark_document_with_no_blocked_loads(doc: &Document)

Source

pub(crate) fn page_headers_available( id: &PipelineId, metadata: Option<Metadata>, can_gc: CanGc, ) -> Option<DomRoot<ServoParser>>

Source

pub(crate) fn process_event(msg: CommonScriptMsg) -> bool

Process a single event as if it were the next event in the queue for this window event-loop. Returns a boolean indicating whether further events should be processed.

Source

pub(crate) fn schedule_timer(&self, request: TimerEventRequest)

Source

pub(crate) fn await_stable_state(task: Microtask)

Source

pub(crate) fn check_load_origin( source: &LoadOrigin, target: &ImmutableOrigin, ) -> bool

Check that two origins are “similar enough”, for now only used to prevent cross-origin JS url evaluation.

https://github.com/whatwg/html/issues/2591

Source

pub(crate) fn navigate( browsing_context: BrowsingContextId, pipeline_id: PipelineId, load_data: LoadData, history_handling: NavigationHistoryBehavior, )

Source

pub(crate) fn process_attach_layout( new_layout_info: NewLayoutInfo, origin: MutableOrigin, )

Source

pub(crate) fn get_top_level_for_browsing_context( sender_pipeline: PipelineId, browsing_context_id: BrowsingContextId, ) -> Option<WebViewId>

Source

pub(crate) fn find_document(id: PipelineId) -> Option<DomRoot<Document>>

Source

pub(crate) fn set_user_interacting(interacting: bool)

Source

pub(crate) fn is_user_interacting() -> bool

Source

pub(crate) fn get_fully_active_document_ids() -> HashSet<PipelineId>

Source

pub(crate) fn find_window_proxy( id: BrowsingContextId, ) -> Option<DomRoot<WindowProxy>>

Source

pub(crate) fn find_window_proxy_by_name( name: &DOMString, ) -> Option<DomRoot<WindowProxy>>

Source

pub(crate) fn worklet_thread_pool() -> Rc<WorkletThreadPool>

Source

fn handle_register_paint_worklet( &self, pipeline_id: PipelineId, name: Atom, properties: Vec<Atom>, painter: Box<dyn Painter>, )

Source

pub(crate) fn push_new_element_queue()

Source

pub(crate) fn pop_current_element_queue(can_gc: CanGc)

Source

pub(crate) fn enqueue_callback_reaction( element: &Element, reaction: CallbackReaction, definition: Option<Rc<CustomElementDefinition>>, )

Source

pub(crate) fn enqueue_upgrade_reaction( element: &Element, definition: Rc<CustomElementDefinition>, )

Source

pub(crate) fn invoke_backup_element_queue(can_gc: CanGc)

Source

pub(crate) fn save_node_id(node_id: String)

Source

pub(crate) fn has_node_id(node_id: &str) -> bool

Source

pub(crate) fn new( state: InitialScriptState, layout_factory: Arc<dyn LayoutFactory>, system_font_service: Arc<SystemFontServiceProxy>, user_agent: Cow<'static, str>, ) -> ScriptThread

Creates a new script thread.

Source

pub(crate) fn get_cx(&self) -> JSContext

Source

fn can_continue_running_inner(&self) -> bool

Check if we are closing.

Source

fn prepare_for_shutdown_inner(&self)

We are closing, ensure no script can run and potentially hang.

Source

pub(crate) fn start(&self, can_gc: CanGc)

Starts the script thread. After calling this method, the script thread will loop receiving messages on its port.

Source

fn process_mouse_move_event( &self, document: &Document, hit_test_result: Option<CompositorHitTestResult>, pressed_mouse_buttons: u16, can_gc: CanGc, )

Process a compositor mouse move event.

Source

fn process_pending_input_events(&self, pipeline_id: PipelineId, can_gc: CanGc)

Process compositor events as part of a “update the rendering task”.

Source

pub(crate) fn update_the_rendering( &self, requested_by_compositor: bool, can_gc: CanGc, )

https://html.spec.whatwg.org/multipage/#update-the-rendering

Attempt to update the rendering and then do a microtask checkpoint if rendering was actually updated.

Source

fn schedule_rendering_opportunity_if_necessary(&self)

Source

fn handle_msgs(&self, can_gc: CanGc) -> bool

Handle incoming messages from other tasks and the task queue.

Source

fn categorize_msg(&self, msg: &MixedMessage) -> ScriptThreadEventCategory

Source

fn profile_event<F, R>( &self, category: ScriptThreadEventCategory, pipeline_id: Option<PipelineId>, f: F, ) -> R
where F: FnOnce() -> R,

Source

fn handle_msg_from_constellation(&self, msg: ScriptThreadMessage, can_gc: CanGc)

Source

fn handle_set_scroll_states( &self, pipeline_id: PipelineId, scroll_states: Vec<ScrollState>, )

Source

fn handle_msg_from_webgpu_server(&self, msg: WebGPUMsg, can_gc: CanGc)

Source

fn handle_msg_from_script(&self, msg: MainThreadScriptMsg)

Source

fn handle_msg_from_devtools(&self, msg: DevtoolScriptControlMsg, can_gc: CanGc)

Source

fn handle_msg_from_image_cache(&self, response: PendingImageResponse)

Source

fn handle_webdriver_msg( &self, pipeline_id: PipelineId, msg: WebDriverScriptCommand, can_gc: CanGc, )

Source

pub(crate) fn handle_resize_message( &self, id: PipelineId, size: WindowSizeData, size_type: WindowSizeType, )

Batch window resize operations into a single “update the rendering” task, or, if a load is in progress, set the window size directly.

Source

fn handle_theme_change_msg(&self, theme: Theme)

Handle changes to the theme, triggering reflow if the theme actually changed.

Source

fn handle_exit_fullscreen(&self, id: PipelineId, can_gc: CanGc)

Source

fn handle_viewport(&self, id: PipelineId, rect: Rect<f32>)

Source

fn handle_new_layout( &self, new_layout_info: NewLayoutInfo, origin: MutableOrigin, )

Source

fn collect_reports(&self, reports_chan: ReportsChan)

Source

fn handle_set_throttled_in_containing_iframe_msg( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, throttled: bool, )

Updates iframe element after a change in visibility

Source

fn handle_set_throttled_msg(&self, id: PipelineId, throttled: bool)

Source

fn handle_set_document_activity_msg( &self, id: PipelineId, activity: DocumentActivity, can_gc: CanGc, )

Handles activity change message

Source

fn handle_focus_iframe_msg( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, can_gc: CanGc, )

Source

fn handle_post_message_msg( &self, pipeline_id: PipelineId, source_pipeline_id: PipelineId, source_browsing_context: WebViewId, origin: Option<ImmutableOrigin>, source_origin: ImmutableOrigin, data: StructuredSerializedData, )

Source

fn handle_stop_delaying_load_events_mode(&self, pipeline_id: PipelineId)

Source

fn handle_unload_document(&self, pipeline_id: PipelineId, can_gc: CanGc)

Source

fn handle_update_pipeline_id( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, webview_id: WebViewId, new_pipeline_id: PipelineId, reason: UpdatePipelineIdReason, can_gc: CanGc, )

Source

fn handle_update_history_state_msg( &self, pipeline_id: PipelineId, history_state_id: Option<HistoryStateId>, url: ServoUrl, can_gc: CanGc, )

Source

fn handle_remove_history_states( &self, pipeline_id: PipelineId, history_states: Vec<HistoryStateId>, )

Source

fn handle_resize_inactive_msg(&self, id: PipelineId, new_size: WindowSizeData)

Window was resized, but this script was not active, so don’t reflow yet

Source

fn handle_page_headers_available( &self, id: &PipelineId, metadata: Option<Metadata>, can_gc: CanGc, ) -> Option<DomRoot<ServoParser>>

We have received notification that the response associated with a load has completed. Kick off the document and frame tree creation process using the result.

Source

fn handle_get_title_msg(&self, pipeline_id: PipelineId)

Handles a request for the window title.

Source

fn handle_exit_pipeline_msg( &self, id: PipelineId, discard_bc: DiscardBrowsingContext, can_gc: CanGc, )

Handles a request to exit a pipeline and shut down layout.

Source

fn handle_exit_script_thread_msg(&self, can_gc: CanGc)

Handles a request to exit the script thread and shut down layout.

Source

pub(crate) fn handle_tick_all_animations_for_testing(id: PipelineId)

Handles animation tick requested during testing.

Source

fn handle_web_font_loaded(&self, pipeline_id: PipelineId, _success: bool)

Handles a Web font being loaded. Does nothing if the page no longer exists.

Source

fn handle_worklet_loaded(&self, pipeline_id: PipelineId)

Handles a worklet being loaded by triggering a relayout of the page. Does nothing if the page no longer exists.

Source

fn handle_storage_event( &self, pipeline_id: PipelineId, storage_type: StorageType, url: ServoUrl, key: Option<String>, old_value: Option<String>, new_value: Option<String>, )

Notify a window of a storage event

Source

fn handle_iframe_load_event( &self, parent_id: PipelineId, browsing_context_id: BrowsingContextId, child_id: PipelineId, can_gc: CanGc, )

Notify the containing document of a child iframe that has completed loading.

Source

fn ask_constellation_for_browsing_context_info( &self, pipeline_id: PipelineId, ) -> Option<(BrowsingContextId, Option<PipelineId>)>

Source

fn ask_constellation_for_top_level_info( &self, sender_pipeline: PipelineId, browsing_context_id: BrowsingContextId, ) -> Option<WebViewId>

Source

fn remote_window_proxy( &self, global_to_clone: &GlobalScope, webview_id: WebViewId, pipeline_id: PipelineId, opener: Option<BrowsingContextId>, ) -> Option<DomRoot<WindowProxy>>

Source

fn local_window_proxy( &self, window: &Window, browsing_context_id: BrowsingContextId, webview_id: WebViewId, parent_info: Option<PipelineId>, opener: Option<BrowsingContextId>, ) -> DomRoot<WindowProxy>

Source

fn load( &self, metadata: Metadata, incomplete: InProgressLoad, can_gc: CanGc, ) -> DomRoot<ServoParser>

The entry point to document loading. Defines bindings, sets up the window and document objects, parses HTML and CSS, and kicks off initial layout.

Source

fn notify_devtools( &self, title: DOMString, url: ServoUrl, is_top_level_global: bool, (browsing_context_id, pipeline_id, worker_id, webview_id): (BrowsingContextId, PipelineId, Option<WorkerId>, WebViewId), )

Source

fn handle_input_event( &self, pipeline_id: PipelineId, event: ConstellationInputEvent, )

Queue compositor events for later dispatching as part of a update_the_rendering task.

Source

fn handle_navigate_iframe( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, load_data: LoadData, history_handling: NavigationHistoryBehavior, can_gc: CanGc, )

Handle a “navigate an iframe” message from the constellation.

Source

pub(crate) fn eval_js_url( global_scope: &GlobalScope, load_data: &mut LoadData, can_gc: CanGc, )

Turn javascript: URL into JS code to eval, according to the steps in https://html.spec.whatwg.org/multipage/#javascript-protocol

Source

fn pre_page_load(&self, incomplete: InProgressLoad)

Instructs the constellation to fetch the document that will be loaded. Stores the InProgressLoad argument until a notification is received that the fetch is complete.

Source

fn handle_navigation_response( &self, pipeline_id: PipelineId, message: FetchResponseMsg, )

Source

fn handle_fetch_metadata( &self, id: PipelineId, request_id: RequestId, fetch_metadata: Result<FetchMetadata, NetworkError>, )

Source

fn handle_fetch_chunk( &self, pipeline_id: PipelineId, request_id: RequestId, chunk: Vec<u8>, )

Source

fn handle_fetch_eof( &self, id: PipelineId, request_id: RequestId, eof: Result<ResourceFetchTiming, NetworkError>, )

Source

fn handle_navigation_redirect(&self, id: PipelineId, metadata: &Metadata)

Source

fn start_page_load_about_blank(&self, incomplete: InProgressLoad)

Synchronously fetch about:blank. Stores the InProgressLoad argument until a notification is received that the fetch is complete.

Source

fn page_load_about_srcdoc(&self, incomplete: InProgressLoad)

Synchronously parse a srcdoc document from a giving HTML string.

Source

fn handle_css_error_reporting( &self, pipeline_id: PipelineId, filename: String, line: u32, column: u32, msg: String, )

Source

fn handle_reload(&self, pipeline_id: PipelineId, can_gc: CanGc)

Source

fn handle_paint_metric( &self, pipeline_id: PipelineId, metric_type: ProgressiveWebMetricType, metric_value: CrossProcessInstant, first_reflow: bool, can_gc: CanGc, )

Source

fn handle_media_session_action( &self, pipeline_id: PipelineId, action: MediaSessionActionType, can_gc: CanGc, )

Source

pub(crate) fn enqueue_microtask(job: Microtask)

Source

fn perform_a_microtask_checkpoint(&self, can_gc: CanGc)

Trait Implementations§

Source§

impl Drop for ScriptThread

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl ScriptThreadFactory for ScriptThread

Source§

fn create( state: InitialScriptState, layout_factory: Arc<dyn LayoutFactory>, system_font_service: Arc<SystemFontServiceProxy>, load_data: LoadData, user_agent: Cow<'static, str>, )

Create a ScriptThread.
Source§

impl Traceable for ScriptThread

Source§

unsafe fn trace(&self, tracer: *mut JSTracer)

Trace self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsVoidPtr for T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Filterable for T

Source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T