Skip to main content

Pipeline

Struct Pipeline 

Source
pub struct Pipeline {
Show 19 fields pub id: PipelineId, pub browsing_context_id: BrowsingContextId, pub webview_id: WebViewId, pub opener: Option<BrowsingContextId>, pub event_loop: Rc<EventLoop>, pub paint_proxy: PaintProxy, pub url: ServoUrl, pub animation_state: AnimationState, pub document_callbacks_active: bool, pub worker_callbacks_active: FxHashSet<WorkerId>, pub last_callbacks_active_sent_to_paint: bool, pub children: Vec<BrowsingContextId>, pub load_data: LoadData, pub history_state_id: Option<HistoryStateId>, pub history_states: HashSet<HistoryStateId>, pub completely_loaded: bool, pub title: String, pub focus_sequence: FocusSequenceNumber, has_active_document: bool,
}
Expand description

A Pipeline is the constellation’s view of a Window. Each pipeline has an event loop (executed by a script thread). A script thread may be responsible for many pipelines.

Fields§

§id: PipelineId

The ID of the pipeline.

§browsing_context_id: BrowsingContextId

The ID of the browsing context that contains this Pipeline.

§webview_id: WebViewId

The WebViewId of the WebView that contains this Pipeline.

§opener: Option<BrowsingContextId>§event_loop: Rc<EventLoop>

The event loop handling this pipeline.

§paint_proxy: PaintProxy

A channel to Paint.

§url: ServoUrl

The most recently loaded URL in this pipeline. Note that this URL can change, for example if the page navigates to a hash URL.

§animation_state: AnimationState

Whether this pipeline is currently running animations. Pipelines that are running animations cause composites to be continually scheduled.

§document_callbacks_active: bool

Whether the document for this pipeline has active animation frame callbacks.

§worker_callbacks_active: FxHashSet<WorkerId>

Workers in this pipeline with active animation frame callbacks.

§last_callbacks_active_sent_to_paint: bool

The last aggregate animation-callback state sent to Paint.

§children: Vec<BrowsingContextId>

The child browsing contexts of this pipeline (these are iframes in the document).

§load_data: LoadData

The Load Data used to create this pipeline.

§history_state_id: Option<HistoryStateId>

The active history state for this pipeline.

§history_states: HashSet<HistoryStateId>

The history states owned by this pipeline.

§completely_loaded: bool

Has this pipeline received a notification that it is completely loaded?

§title: String

The title of this pipeline’s document.

§focus_sequence: FocusSequenceNumber§has_active_document: bool

Whether or not this Pipeline has an actively loading/loaded document. When there is no active document, the Pipeline will never be unthrottled. Throttled pipelines do not update animations and their timers are slowed.

Implementations§

Source§

impl Pipeline

Source

pub(crate) fn spawn<STF: ScriptThreadFactory, SWF: ServiceWorkerManagerFactory>( new_pipeline_info: NewPipelineInfo, event_loop: Rc<EventLoop>, constellation: &Constellation<STF, SWF>, webview_hidden: bool, ) -> Result<Self, SendError>

Possibly starts a script thread, in a new process if requested.

Source

pub fn new_already_spawned( id: PipelineId, browsing_context_id: BrowsingContextId, webview_id: WebViewId, opener: Option<BrowsingContextId>, event_loop: Rc<EventLoop>, paint_proxy: PaintProxy, webview_hidden: bool, load_data: LoadData, ) -> Self

Creates a new Pipeline, after it has been spawned in its EventLoop.

Source

pub fn send_exit_message_to_script( &self, discard_bc: DiscardBrowsingContext, ) -> bool

Let the ScriptThread for this Pipeline know that it has exited. If the ScriptThread hasn’t panicked and is still alive, it will send a PipelineExited message back to the Constellation when it finishes cleaning up.

Returns true if the channel is still alive or false otherwise.

Source

pub fn set_activity(&self, activity: DocumentActivity)

Notify this pipeline of its activity.

Source

pub fn to_sendable(&self) -> CompositionPipeline

Paint’s view of a pipeline.

Source

pub fn add_child(&mut self, browsing_context_id: BrowsingContextId)

Add a new child browsing context.

Source

pub fn remove_child(&mut self, browsing_context_id: BrowsingContextId)

Remove a child browsing context.

Source

pub(crate) fn set_has_active_document(&mut self, has_active_document: bool)

Set whether or not this Pipeline has an active document.

Source

pub(crate) fn send_throttle_messages(&self, throttled: bool)

Set whether this Pipeline is throttled or unthrottled. If the Pipeline does not have an active Document, it will not be unthrottled until it does.

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> 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> 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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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<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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,