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.
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.
source_origin: ImmutableOrigin
The source origin of the message. https://html.spec.whatwg.org/multipage/#dom-messageevent-origin
data: StructuredSerializedData
The data to be posted.
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)
Successful response to crate::ConstellationControlMsg::SetThrottled.
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<'de> Deserialize<'de> for ScriptMsg
impl<'de> Deserialize<'de> for ScriptMsg
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl !Freeze for ScriptMsg
impl !RefUnwindSafe for ScriptMsg
impl Send for ScriptMsg
impl !Sync for ScriptMsg
impl Unpin for ScriptMsg
impl UnwindSafe for ScriptMsg
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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