Enum script_traits::ScriptMsg

source ·
pub enum ScriptMsg {
Show 52 variants CompleteMessagePortTransfer(MessagePortRouterId, Vec<MessagePortId>), MessagePortTransferResult(Option<MessagePortRouterId>, Vec<MessagePortId>, HashMap<MessagePortId, VecDeque<PortMessageTask>>), NewMessagePort(MessagePortRouterId, MessagePortId), NewMessagePortRouter(MessagePortRouterId, IpcSender<MessagePortMsg>), RemoveMessagePortRouter(MessagePortRouterId), RerouteMessagePort(MessagePortId, PortMessageTask), MessagePortShipped(MessagePortId), RemoveMessagePort(MessagePortId), EntanglePorts(MessagePortId, MessagePortId), NewBroadcastChannelRouter(BroadcastChannelRouterId, IpcSender<BroadcastMsg>, ImmutableOrigin), RemoveBroadcastChannelRouter(BroadcastChannelRouterId, ImmutableOrigin), NewBroadcastChannelNameInRouter(BroadcastChannelRouterId, String, ImmutableOrigin), RemoveBroadcastChannelNameInRouter(BroadcastChannelRouterId, String, ImmutableOrigin), ScheduleBroadcast(BroadcastChannelRouterId, BroadcastMsg), ForwardToEmbedder(EmbedderMsg), InitiateNavigateRequest(RequestBuilder, IpcReceiver<()>), BroadcastStorageEvent(StorageType, ServoUrl, Option<String>, Option<String>, Option<String>), ChangeRunningAnimationsState(AnimationState), CreateCanvasPaintThread(Size2D<u64>, IpcSender<(IpcSender<CanvasMsg>, CanvasId)>), Focus, GetTopForBrowsingContext(BrowsingContextId, IpcSender<Option<TopLevelBrowsingContextId>>), GetBrowsingContextInfo(PipelineId, IpcSender<Option<(BrowsingContextId, Option<PipelineId>)>>), GetChildBrowsingContextId(BrowsingContextId, usize, IpcSender<Option<BrowsingContextId>>), LoadComplete, LoadUrl(LoadData, HistoryEntryReplacement), AbortLoadUrl, PostMessage { target: BrowsingContextId, source: PipelineId, target_origin: Option<ImmutableOrigin>, source_origin: ImmutableOrigin, data: StructuredSerializedData, }, NavigatedToFragment(ServoUrl, HistoryEntryReplacement), TraverseHistory(TraversalDirection), PushHistoryState(HistoryStateId, ServoUrl), ReplaceHistoryState(HistoryStateId, ServoUrl), JointSessionHistoryLength(IpcSender<u32>), RemoveIFrame(BrowsingContextId, IpcSender<Vec<PipelineId>>), SetThrottledComplete(bool), ScriptLoadedURLInIFrame(IFrameLoadInfoWithData), ScriptNewIFrame(IFrameLoadInfoWithData), ScriptNewAuxiliary(AuxiliaryBrowsingContextLoadInfo), ActivateDocument, SetDocumentState(DocumentState), SetLayoutEpoch(Epoch, IpcSender<bool>), SetFinalUrl(ServoUrl), TouchEventProcessed(EventResult), LogEntry(Option<String>, LogEntry), DiscardDocument, DiscardTopLevelBrowsingContext, PipelineExited, ForwardDOMMessage(DOMMessage, ServoUrl), ScheduleJob(Job), MediaSessionEvent(PipelineId, MediaSessionEvent), RequestAdapter(IpcSender<WebGPUResponse>, RequestAdapterOptions, AdapterId), GetWebGPUChan(IpcSender<Option<WebGPU>>), TitleChanged(PipelineId, String),
}
Expand description

Messages from the script to the constellation.

Variants§

§

CompleteMessagePortTransfer(MessagePortRouterId, Vec<MessagePortId>)

Request to complete the transfer of a set of ports to a router.

§

MessagePortTransferResult(Option<MessagePortRouterId>, Vec<MessagePortId>, HashMap<MessagePortId, VecDeque<PortMessageTask>>)

The results of attempting to complete the transfer of a batch of ports.

§

NewMessagePort(MessagePortRouterId, MessagePortId)

A new message-port was created or transferred, with corresponding control-sender.

§

NewMessagePortRouter(MessagePortRouterId, IpcSender<MessagePortMsg>)

A global has started managing message-ports

§

RemoveMessagePortRouter(MessagePortRouterId)

A global has stopped managing message-ports

§

RerouteMessagePort(MessagePortId, PortMessageTask)

A task requires re-routing to an already shipped message-port.

§

MessagePortShipped(MessagePortId)

A message-port was shipped, let the entangled port know.

§

RemoveMessagePort(MessagePortId)

A message-port has been discarded by script.

§

EntanglePorts(MessagePortId, MessagePortId)

Entangle two message-ports.

§

NewBroadcastChannelRouter(BroadcastChannelRouterId, IpcSender<BroadcastMsg>, ImmutableOrigin)

A global has started managing broadcast-channels.

§

RemoveBroadcastChannelRouter(BroadcastChannelRouterId, ImmutableOrigin)

A global has stopped managing broadcast-channels.

§

NewBroadcastChannelNameInRouter(BroadcastChannelRouterId, String, ImmutableOrigin)

A global started managing broadcast channels for a given channel-name.

§

RemoveBroadcastChannelNameInRouter(BroadcastChannelRouterId, String, ImmutableOrigin)

A global stopped managing broadcast channels for a given channel-name.

§

ScheduleBroadcast(BroadcastChannelRouterId, BroadcastMsg)

Broadcast a message to all same-origin broadcast channels, excluding the source of the broadcast.

§

ForwardToEmbedder(EmbedderMsg)

Forward a message to the embedder.

§

InitiateNavigateRequest(RequestBuilder, IpcReceiver<()>)

Requests are sent to constellation and fetches are checked manually for cross-origin loads

§

BroadcastStorageEvent(StorageType, ServoUrl, Option<String>, Option<String>, Option<String>)

Broadcast a storage event to every same-origin pipeline. The strings are key, old value and new value.

§

ChangeRunningAnimationsState(AnimationState)

Indicates whether this pipeline is currently running animations.

§

CreateCanvasPaintThread(Size2D<u64>, IpcSender<(IpcSender<CanvasMsg>, CanvasId)>)

Requests that a new 2D canvas thread be created. (This is done in the constellation because 2D canvases may use the GPU and we don’t want to give untrusted content access to the GPU.)

§

Focus

Notifies the constellation that this frame has received focus.

§

GetTopForBrowsingContext(BrowsingContextId, IpcSender<Option<TopLevelBrowsingContextId>>)

Get the top-level browsing context info for a given browsing context.

§

GetBrowsingContextInfo(PipelineId, IpcSender<Option<(BrowsingContextId, Option<PipelineId>)>>)

Get the browsing context id of the browsing context in which pipeline is embedded and the parent pipeline id of that browsing context.

§

GetChildBrowsingContextId(BrowsingContextId, usize, IpcSender<Option<BrowsingContextId>>)

Get the nth child browsing context ID for a given browsing context, sorted in tree order.

§

LoadComplete

All pending loads are complete, and the load event for this pipeline has been dispatched.

§

LoadUrl(LoadData, HistoryEntryReplacement)

A new load has been requested, with an option to replace the current entry once loaded instead of adding a new entry.

§

AbortLoadUrl

Abort loading after sending a LoadUrl message.

§

PostMessage

Post a message to the currently active window of a given browsing context.

Fields

§target: BrowsingContextId

The target of the posted message.

§source: PipelineId

The source of the posted message.

§target_origin: Option<ImmutableOrigin>

The expected origin of the target.

§data: StructuredSerializedData

The data to be posted.

§

NavigatedToFragment(ServoUrl, HistoryEntryReplacement)

Inform the constellation that a fragment was navigated to and whether or not it was a replacement navigation.

§

TraverseHistory(TraversalDirection)

HTMLIFrameElement Forward or Back traversal.

§

PushHistoryState(HistoryStateId, ServoUrl)

Inform the constellation of a pushed history state.

§

ReplaceHistoryState(HistoryStateId, ServoUrl)

Inform the constellation of a replaced history state.

§

JointSessionHistoryLength(IpcSender<u32>)

Gets the length of the joint session history from the constellation.

§

RemoveIFrame(BrowsingContextId, IpcSender<Vec<PipelineId>>)

Notification that this iframe should be removed. Returns a list of pipelines which were closed.

§

SetThrottledComplete(bool)

§

ScriptLoadedURLInIFrame(IFrameLoadInfoWithData)

A load has been requested in an IFrame.

§

ScriptNewIFrame(IFrameLoadInfoWithData)

A load of the initial about:blank has been completed in an IFrame.

§

ScriptNewAuxiliary(AuxiliaryBrowsingContextLoadInfo)

Script has opened a new auxiliary browsing context.

§

ActivateDocument

Mark a new document as active

§

SetDocumentState(DocumentState)

Set the document state for a pipeline (used by screenshot / reftests)

§

SetLayoutEpoch(Epoch, IpcSender<bool>)

Update the layout epoch in the constellation (used by screenshot / reftests).

§

SetFinalUrl(ServoUrl)

Update the pipeline Url, which can change after redirections.

§

TouchEventProcessed(EventResult)

Script has handled a touch event, and either prevented or allowed default actions.

§

LogEntry(Option<String>, LogEntry)

A log entry, with the top-level browsing context id and thread name

§

DiscardDocument

Discard the document.

§

DiscardTopLevelBrowsingContext

Discard the browsing context.

§

PipelineExited

Notifies the constellation that this pipeline has exited.

§

ForwardDOMMessage(DOMMessage, ServoUrl)

Send messages from postMessage calls from serviceworker to constellation for storing in service worker manager

§

ScheduleJob(Job)

§

MediaSessionEvent(PipelineId, MediaSessionEvent)

Notifies the constellation about media session events (i.e. when there is metadata for the active media session, playback state changes…).

§

RequestAdapter(IpcSender<WebGPUResponse>, RequestAdapterOptions, AdapterId)

Create a WebGPU Adapter instance

§

GetWebGPUChan(IpcSender<Option<WebGPU>>)

Get WebGPU channel

§

TitleChanged(PipelineId, String)

Notify the constellation of a pipeline’s document’s title.

Trait Implementations§

source§

impl Debug for ScriptMsg

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ScriptMsg

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for ScriptMsg

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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.
§

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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

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

source§

impl<T> MaybeSendSync for T

source§

impl<T> WasmNotSend for T
where T: Send,