mirror of
https://github.com/servo/servo.git
synced 2025-06-08 16:43:28 +00:00
Auto merge of #24664 - gterzian:fix_port_transfer, r=jdm
Fix loophole in messageport transfer <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #24600 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
0d2c2045cc
7 changed files with 468 additions and 52 deletions
|
@ -30,6 +30,7 @@ use net_traits::storage_thread::StorageType;
|
|||
use net_traits::CoreResourceMsg;
|
||||
use servo_url::ImmutableOrigin;
|
||||
use servo_url::ServoUrl;
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::fmt;
|
||||
use style_traits::viewport::ViewportConstraints;
|
||||
use style_traits::CSSPixel;
|
||||
|
@ -114,6 +115,17 @@ pub enum HistoryEntryReplacement {
|
|||
/// Messages from the script to the constellation.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum ScriptMsg {
|
||||
/// Request to complete the transfer of a set of ports to a router.
|
||||
CompleteMessagePortTransfer(MessagePortRouterId, Vec<MessagePortId>),
|
||||
/// The results of attempting to complete the transfer of a batch of ports.
|
||||
MessagePortTransferResult(
|
||||
/* The router whose transfer of ports succeeded, if any */
|
||||
Option<MessagePortRouterId>,
|
||||
/* The ids of ports transferred successfully */
|
||||
Vec<MessagePortId>,
|
||||
/* The ids, and buffers, of ports whose transfer failed */
|
||||
HashMap<MessagePortId, VecDeque<PortMessageTask>>,
|
||||
),
|
||||
/// A new message-port was created or transferred, with corresponding control-sender.
|
||||
NewMessagePort(MessagePortRouterId, MessagePortId),
|
||||
/// A global has started managing message-ports
|
||||
|
@ -248,6 +260,8 @@ impl fmt::Debug for ScriptMsg {
|
|||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
use self::ScriptMsg::*;
|
||||
let variant = match *self {
|
||||
CompleteMessagePortTransfer(..) => "CompleteMessagePortTransfer",
|
||||
MessagePortTransferResult(..) => "MessagePortTransferResult",
|
||||
NewMessagePortRouter(..) => "NewMessagePortRouter",
|
||||
RemoveMessagePortRouter(..) => "RemoveMessagePortRouter",
|
||||
NewMessagePort(..) => "NewMessagePort",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue