mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
clippy: Fix warnings in components/constellation
(#31610)
* clippy: fix warnings in components/constellation * fix: review comments
This commit is contained in:
parent
11c16adcd1
commit
7f1ef4c7fe
7 changed files with 114 additions and 112 deletions
|
@ -2,6 +2,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#![allow(clippy::too_many_arguments)]
|
||||||
|
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
|
||||||
use euclid::Size2D;
|
use euclid::Size2D;
|
||||||
|
@ -198,7 +200,7 @@ impl<'a> Iterator for AllBrowsingContextsIterator<'a> {
|
||||||
let child_browsing_context_ids = browsing_context
|
let child_browsing_context_ids = browsing_context
|
||||||
.pipelines
|
.pipelines
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|pipeline_id| pipelines.get(&pipeline_id))
|
.filter_map(|pipeline_id| pipelines.get(pipeline_id))
|
||||||
.flat_map(|pipeline| pipeline.children.iter());
|
.flat_map(|pipeline| pipeline.children.iter());
|
||||||
self.stack.extend(child_browsing_context_ids);
|
self.stack.extend(child_browsing_context_ids);
|
||||||
return Some(browsing_context);
|
return Some(browsing_context);
|
||||||
|
|
|
@ -84,6 +84,8 @@
|
||||||
//!
|
//!
|
||||||
//! See <https://github.com/servo/servo/issues/14704>
|
//! See <https://github.com/servo/servo/issues/14704>
|
||||||
|
|
||||||
|
#![allow(clippy::too_many_arguments)]
|
||||||
|
|
||||||
use std::borrow::{Cow, ToOwned};
|
use std::borrow::{Cow, ToOwned};
|
||||||
use std::collections::hash_map::Entry;
|
use std::collections::hash_map::Entry;
|
||||||
use std::collections::{HashMap, HashSet, VecDeque};
|
use std::collections::{HashMap, HashSet, VecDeque};
|
||||||
|
@ -708,7 +710,7 @@ where
|
||||||
ROUTER.add_route(
|
ROUTER.add_route(
|
||||||
webrender_ipc_receiver.to_opaque(),
|
webrender_ipc_receiver.to_opaque(),
|
||||||
Box::new(move |message| {
|
Box::new(move |message| {
|
||||||
let _ = compositor_proxy.send(CompositorMsg::Forwarded(
|
compositor_proxy.send(CompositorMsg::Forwarded(
|
||||||
ForwardedToCompositorMsg::Layout(
|
ForwardedToCompositorMsg::Layout(
|
||||||
message.to().expect("conversion failure"),
|
message.to().expect("conversion failure"),
|
||||||
),
|
),
|
||||||
|
@ -720,7 +722,7 @@ where
|
||||||
ROUTER.add_route(
|
ROUTER.add_route(
|
||||||
webrender_image_ipc_receiver.to_opaque(),
|
webrender_image_ipc_receiver.to_opaque(),
|
||||||
Box::new(move |message| {
|
Box::new(move |message| {
|
||||||
let _ = compositor_proxy.send(CompositorMsg::Forwarded(
|
compositor_proxy.send(CompositorMsg::Forwarded(
|
||||||
ForwardedToCompositorMsg::Net(
|
ForwardedToCompositorMsg::Net(
|
||||||
message.to().expect("conversion failure"),
|
message.to().expect("conversion failure"),
|
||||||
),
|
),
|
||||||
|
@ -743,12 +745,12 @@ where
|
||||||
background_monitor_register,
|
background_monitor_register,
|
||||||
background_monitor_control_senders: background_hang_monitor_control_ipc_senders,
|
background_monitor_control_senders: background_hang_monitor_control_ipc_senders,
|
||||||
layout_sender: layout_ipc_sender,
|
layout_sender: layout_ipc_sender,
|
||||||
script_receiver: script_receiver,
|
script_receiver,
|
||||||
compositor_receiver: compositor_receiver,
|
compositor_receiver,
|
||||||
layout_factory,
|
layout_factory,
|
||||||
layout_receiver: layout_receiver,
|
layout_receiver,
|
||||||
network_listener_sender: network_listener_sender,
|
network_listener_sender,
|
||||||
network_listener_receiver: network_listener_receiver,
|
network_listener_receiver,
|
||||||
embedder_proxy: state.embedder_proxy,
|
embedder_proxy: state.embedder_proxy,
|
||||||
compositor_proxy: state.compositor_proxy,
|
compositor_proxy: state.compositor_proxy,
|
||||||
webviews: WebViewManager::default(),
|
webviews: WebViewManager::default(),
|
||||||
|
@ -758,7 +760,7 @@ where
|
||||||
private_resource_threads: state.private_resource_threads,
|
private_resource_threads: state.private_resource_threads,
|
||||||
font_cache_thread: state.font_cache_thread,
|
font_cache_thread: state.font_cache_thread,
|
||||||
sw_managers: Default::default(),
|
sw_managers: Default::default(),
|
||||||
swmanager_receiver: swmanager_receiver,
|
swmanager_receiver,
|
||||||
swmanager_ipc_sender,
|
swmanager_ipc_sender,
|
||||||
browsing_context_group_set: Default::default(),
|
browsing_context_group_set: Default::default(),
|
||||||
browsing_context_group_next_id: Default::default(),
|
browsing_context_group_next_id: Default::default(),
|
||||||
|
@ -854,7 +856,7 @@ where
|
||||||
Some(browsing_context_id) => {
|
Some(browsing_context_id) => {
|
||||||
let opener = self
|
let opener = self
|
||||||
.browsing_contexts
|
.browsing_contexts
|
||||||
.get(&browsing_context_id)
|
.get(browsing_context_id)
|
||||||
.ok_or("Opener was closed before the openee started")?;
|
.ok_or("Opener was closed before the openee started")?;
|
||||||
self.browsing_context_group_set
|
self.browsing_context_group_set
|
||||||
.get(&opener.bc_group_id)
|
.get(&opener.bc_group_id)
|
||||||
|
@ -866,7 +868,7 @@ where
|
||||||
.filter_map(|(_, bc_group)| {
|
.filter_map(|(_, bc_group)| {
|
||||||
if bc_group
|
if bc_group
|
||||||
.top_level_browsing_context_set
|
.top_level_browsing_context_set
|
||||||
.contains(&top_level_browsing_context_id)
|
.contains(top_level_browsing_context_id)
|
||||||
{
|
{
|
||||||
Some(bc_group)
|
Some(bc_group)
|
||||||
} else {
|
} else {
|
||||||
|
@ -911,7 +913,7 @@ where
|
||||||
.top_level_browsing_context_set
|
.top_level_browsing_context_set
|
||||||
.contains(&top_level_browsing_context_id)
|
.contains(&top_level_browsing_context_id)
|
||||||
{
|
{
|
||||||
Some(id.clone())
|
Some(*id)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
@ -925,10 +927,10 @@ where
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if let Some(bc_group) = self.browsing_context_group_set.get_mut(&bc_group_id) {
|
if let Some(bc_group) = self.browsing_context_group_set.get_mut(&bc_group_id) {
|
||||||
if !bc_group
|
if bc_group
|
||||||
.event_loops
|
.event_loops
|
||||||
.insert(host.clone(), event_loop)
|
.insert(host.clone(), event_loop)
|
||||||
.is_none()
|
.is_some()
|
||||||
{
|
{
|
||||||
warn!(
|
warn!(
|
||||||
"Double-setting an event-loop for {:?} at {:?}",
|
"Double-setting an event-loop for {:?} at {:?}",
|
||||||
|
@ -1024,7 +1026,7 @@ where
|
||||||
opener,
|
opener,
|
||||||
script_to_constellation_chan: ScriptToConstellationChan {
|
script_to_constellation_chan: ScriptToConstellationChan {
|
||||||
sender: self.script_sender.clone(),
|
sender: self.script_sender.clone(),
|
||||||
pipeline_id: pipeline_id,
|
pipeline_id,
|
||||||
},
|
},
|
||||||
namespace_request_sender: self.namespace_ipc_sender.clone(),
|
namespace_request_sender: self.namespace_ipc_sender.clone(),
|
||||||
pipeline_namespace_id: self.next_pipeline_namespace_id(),
|
pipeline_namespace_id: self.next_pipeline_namespace_id(),
|
||||||
|
@ -1151,7 +1153,7 @@ where
|
||||||
})
|
})
|
||||||
.last()
|
.last()
|
||||||
{
|
{
|
||||||
Some(id) => id.clone(),
|
Some(id) => *id,
|
||||||
None => {
|
None => {
|
||||||
warn!("Top-level was unexpectedly removed from its top_level_browsing_context_set");
|
warn!("Top-level was unexpectedly removed from its top_level_browsing_context_set");
|
||||||
return;
|
return;
|
||||||
|
@ -1209,7 +1211,7 @@ where
|
||||||
let scheduler_timeout = self
|
let scheduler_timeout = self
|
||||||
.timer_scheduler
|
.timer_scheduler
|
||||||
.check_timers()
|
.check_timers()
|
||||||
.map(|timeout| after(timeout))
|
.map(after)
|
||||||
.unwrap_or(never());
|
.unwrap_or(never());
|
||||||
|
|
||||||
// Get one incoming request.
|
// Get one incoming request.
|
||||||
|
@ -1401,12 +1403,12 @@ where
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
return warn!(
|
warn!(
|
||||||
"{}: AllowNavigationResponse for unknown request",
|
"{}: AllowNavigationResponse for unknown request",
|
||||||
pipeline_id
|
pipeline_id
|
||||||
);
|
)
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
FromCompositorMsg::ClearCache => {
|
FromCompositorMsg::ClearCache => {
|
||||||
self.public_resource_threads.clear_cache();
|
self.public_resource_threads.clear_cache();
|
||||||
|
@ -1771,7 +1773,7 @@ where
|
||||||
let result = self
|
let result = self
|
||||||
.browsing_contexts
|
.browsing_contexts
|
||||||
.get(&browsing_context_id)
|
.get(&browsing_context_id)
|
||||||
.and_then(|bc| Some(bc.top_level_id));
|
.map(|bc| bc.top_level_id);
|
||||||
if let Err(e) = response_sender.send(result) {
|
if let Err(e) = response_sender.send(result) {
|
||||||
warn!(
|
warn!(
|
||||||
"Sending reply to get top for browsing context info failed ({:?}).",
|
"Sending reply to get top for browsing context info failed ({:?}).",
|
||||||
|
@ -1789,7 +1791,7 @@ where
|
||||||
.get(&browsing_context_id)
|
.get(&browsing_context_id)
|
||||||
.and_then(|bc| self.pipelines.get(&bc.pipeline_id))
|
.and_then(|bc| self.pipelines.get(&bc.pipeline_id))
|
||||||
.and_then(|pipeline| pipeline.children.get(index))
|
.and_then(|pipeline| pipeline.children.get(index))
|
||||||
.map(|maybe_bcid| *maybe_bcid);
|
.copied();
|
||||||
if let Err(e) = response_sender.send(result) {
|
if let Err(e) = response_sender.send(result) {
|
||||||
warn!(
|
warn!(
|
||||||
"Sending reply to get child browsing context ID failed ({:?}).",
|
"Sending reply to get child browsing context ID failed ({:?}).",
|
||||||
|
@ -1825,15 +1827,13 @@ where
|
||||||
// the active media session.
|
// the active media session.
|
||||||
// Events coming from inactive media sessions are discarded.
|
// Events coming from inactive media sessions are discarded.
|
||||||
if self.active_media_session.is_some() {
|
if self.active_media_session.is_some() {
|
||||||
match event {
|
if let MediaSessionEvent::PlaybackStateChange(ref state) = event {
|
||||||
MediaSessionEvent::PlaybackStateChange(ref state) => {
|
if !matches!(
|
||||||
match state {
|
state,
|
||||||
MediaSessionPlaybackState::Playing |
|
MediaSessionPlaybackState::Playing | MediaSessionPlaybackState::Paused
|
||||||
MediaSessionPlaybackState::Paused => (),
|
) {
|
||||||
_ => return,
|
return;
|
||||||
};
|
}
|
||||||
},
|
|
||||||
_ => (),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
self.active_media_session = Some(pipeline_id);
|
self.active_media_session = Some(pipeline_id);
|
||||||
|
@ -1869,7 +1869,7 @@ where
|
||||||
pipeline_id: &PipelineId,
|
pipeline_id: &PipelineId,
|
||||||
origin: &ImmutableOrigin,
|
origin: &ImmutableOrigin,
|
||||||
) -> Result<(), ()> {
|
) -> Result<(), ()> {
|
||||||
let pipeline_origin = match self.pipelines.get(&pipeline_id) {
|
let pipeline_origin = match self.pipelines.get(pipeline_id) {
|
||||||
Some(pipeline) => pipeline.load_data.url.origin(),
|
Some(pipeline) => pipeline.load_data.url.origin(),
|
||||||
None => {
|
None => {
|
||||||
warn!("Received message from closed or unknown pipeline.");
|
warn!("Received message from closed or unknown pipeline.");
|
||||||
|
@ -1909,7 +1909,7 @@ where
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(broadcast_ipc_sender) = self.broadcast_routers.get(&router) {
|
if let Some(broadcast_ipc_sender) = self.broadcast_routers.get(router) {
|
||||||
if broadcast_ipc_sender.send(message.clone()).is_err() {
|
if broadcast_ipc_sender.send(message.clone()).is_err() {
|
||||||
warn!("Failed to broadcast message to router: {:?}", router);
|
warn!("Failed to broadcast message to router: {:?}", router);
|
||||||
}
|
}
|
||||||
|
@ -1974,12 +1974,9 @@ where
|
||||||
{
|
{
|
||||||
return warn!("Attempt to add channel name from an unexpected origin.");
|
return warn!("Attempt to add channel name from an unexpected origin.");
|
||||||
}
|
}
|
||||||
let channels = self
|
let channels = self.broadcast_channels.entry(origin).or_default();
|
||||||
.broadcast_channels
|
|
||||||
.entry(origin)
|
|
||||||
.or_insert_with(HashMap::new);
|
|
||||||
|
|
||||||
let routers = channels.entry(channel_name).or_insert_with(Vec::new);
|
let routers = channels.entry(channel_name).or_default();
|
||||||
|
|
||||||
routers.push(router_id);
|
routers.push(router_id);
|
||||||
}
|
}
|
||||||
|
@ -2045,7 +2042,7 @@ where
|
||||||
};
|
};
|
||||||
let browsing_context_group = if let Some(bcg) = self
|
let browsing_context_group = if let Some(bcg) = self
|
||||||
.browsing_context_group_set
|
.browsing_context_group_set
|
||||||
.get_mut(&browsing_context_group_id)
|
.get_mut(browsing_context_group_id)
|
||||||
{
|
{
|
||||||
bcg
|
bcg
|
||||||
} else {
|
} else {
|
||||||
|
@ -2074,7 +2071,7 @@ where
|
||||||
FromScriptMsg::RequestAdapter(response_sender, options, ids) => match webgpu_chan {
|
FromScriptMsg::RequestAdapter(response_sender, options, ids) => match webgpu_chan {
|
||||||
None => {
|
None => {
|
||||||
if let Err(e) = response_sender.send(None) {
|
if let Err(e) = response_sender.send(None) {
|
||||||
return warn!("Failed to send request adapter message: {}", e);
|
warn!("Failed to send request adapter message: {}", e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Some(webgpu_chan) => {
|
Some(webgpu_chan) => {
|
||||||
|
@ -2090,13 +2087,13 @@ where
|
||||||
},
|
},
|
||||||
FromScriptMsg::GetWebGPUChan(response_sender) => {
|
FromScriptMsg::GetWebGPUChan(response_sender) => {
|
||||||
if response_sender.send(webgpu_chan).is_err() {
|
if response_sender.send(webgpu_chan).is_err() {
|
||||||
return warn!(
|
warn!(
|
||||||
"{}: Failed to send WebGPU channel to pipeline",
|
"{}: Failed to send WebGPU channel to pipeline",
|
||||||
source_pipeline_id
|
source_pipeline_id
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => return warn!("Wrong message type in handle_wgpu_request"),
|
_ => warn!("Wrong message type in handle_wgpu_request"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2347,7 +2344,7 @@ where
|
||||||
// In both the managed and completion of a transfer case, we forward the message.
|
// In both the managed and completion of a transfer case, we forward the message.
|
||||||
// Note that in both cases, if the port is transferred before the message is handled,
|
// Note that in both cases, if the port is transferred before the message is handled,
|
||||||
// it will be sent back here and buffered while the transfer is ongoing.
|
// it will be sent back here and buffered while the transfer is ongoing.
|
||||||
if let Some(ipc_sender) = self.message_port_routers.get(&router_id) {
|
if let Some(ipc_sender) = self.message_port_routers.get(router_id) {
|
||||||
let _ = ipc_sender.send(MessagePortMsg::NewTask(port_id, task));
|
let _ = ipc_sender.send(MessagePortMsg::NewTask(port_id, task));
|
||||||
} else {
|
} else {
|
||||||
warn!("No message-port sender for {:?}", router_id);
|
warn!("No message-port sender for {:?}", router_id);
|
||||||
|
@ -2694,7 +2691,7 @@ where
|
||||||
let receivers = self
|
let receivers = self
|
||||||
.browsing_context_group_set
|
.browsing_context_group_set
|
||||||
.values()
|
.values()
|
||||||
.map(|browsing_context_group| {
|
.flat_map(|browsing_context_group| {
|
||||||
browsing_context_group.webgpus.values().map(|webgpu| {
|
browsing_context_group.webgpus.values().map(|webgpu| {
|
||||||
let (sender, receiver) = ipc::channel().expect("Failed to create IPC channel!");
|
let (sender, receiver) = ipc::channel().expect("Failed to create IPC channel!");
|
||||||
if let Err(e) = webgpu.exit(sender) {
|
if let Err(e) = webgpu.exit(sender) {
|
||||||
|
@ -2705,8 +2702,7 @@ where
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.flatten()
|
.flatten();
|
||||||
.filter_map(|r| r);
|
|
||||||
|
|
||||||
for receiver in receivers {
|
for receiver in receivers {
|
||||||
if let Err(e) = receiver.recv() {
|
if let Err(e) = receiver.recv() {
|
||||||
|
@ -2978,7 +2974,7 @@ where
|
||||||
let new_bc_group_id = self.next_browsing_context_group_id();
|
let new_bc_group_id = self.next_browsing_context_group_id();
|
||||||
new_bc_group
|
new_bc_group
|
||||||
.top_level_browsing_context_set
|
.top_level_browsing_context_set
|
||||||
.insert(top_level_browsing_context_id.clone());
|
.insert(top_level_browsing_context_id);
|
||||||
self.browsing_context_group_set
|
self.browsing_context_group_set
|
||||||
.insert(new_bc_group_id, new_bc_group);
|
.insert(new_bc_group_id, new_bc_group);
|
||||||
|
|
||||||
|
@ -3226,10 +3222,10 @@ where
|
||||||
browsing_context_is_visible,
|
browsing_context_is_visible,
|
||||||
);
|
);
|
||||||
self.add_pending_change(SessionHistoryChange {
|
self.add_pending_change(SessionHistoryChange {
|
||||||
top_level_browsing_context_id: top_level_browsing_context_id,
|
top_level_browsing_context_id,
|
||||||
browsing_context_id: browsing_context_id,
|
browsing_context_id,
|
||||||
new_pipeline_id: new_pipeline_id,
|
new_pipeline_id,
|
||||||
replace: replace,
|
replace,
|
||||||
// Browsing context for iframe already exists.
|
// Browsing context for iframe already exists.
|
||||||
new_browsing_context_info: None,
|
new_browsing_context_info: None,
|
||||||
window_size: load_info.window_size.initial_viewport,
|
window_size: load_info.window_size.initial_viewport,
|
||||||
|
@ -3363,7 +3359,7 @@ where
|
||||||
};
|
};
|
||||||
bc_group
|
bc_group
|
||||||
.top_level_browsing_context_set
|
.top_level_browsing_context_set
|
||||||
.insert(new_top_level_browsing_context_id.clone());
|
.insert(new_top_level_browsing_context_id);
|
||||||
|
|
||||||
self.add_pending_change(SessionHistoryChange {
|
self.add_pending_change(SessionHistoryChange {
|
||||||
top_level_browsing_context_id: new_top_level_browsing_context_id,
|
top_level_browsing_context_id: new_top_level_browsing_context_id,
|
||||||
|
@ -3564,9 +3560,9 @@ where
|
||||||
is_visible,
|
is_visible,
|
||||||
);
|
);
|
||||||
self.add_pending_change(SessionHistoryChange {
|
self.add_pending_change(SessionHistoryChange {
|
||||||
top_level_browsing_context_id: top_level_browsing_context_id,
|
top_level_browsing_context_id,
|
||||||
browsing_context_id: browsing_context_id,
|
browsing_context_id,
|
||||||
new_pipeline_id: new_pipeline_id,
|
new_pipeline_id,
|
||||||
replace,
|
replace,
|
||||||
// `load_url` is always invoked on an existing browsing context.
|
// `load_url` is always invoked on an existing browsing context.
|
||||||
new_browsing_context_info: None,
|
new_browsing_context_info: None,
|
||||||
|
@ -3660,7 +3656,7 @@ where
|
||||||
|
|
||||||
match replacement_enabled {
|
match replacement_enabled {
|
||||||
HistoryEntryReplacement::Disabled => {
|
HistoryEntryReplacement::Disabled => {
|
||||||
let diff = SessionHistoryDiff::HashDiff {
|
let diff = SessionHistoryDiff::Hash {
|
||||||
pipeline_reloader: NeedsToReload::No(pipeline_id),
|
pipeline_reloader: NeedsToReload::No(pipeline_id),
|
||||||
new_url,
|
new_url,
|
||||||
old_url,
|
old_url,
|
||||||
|
@ -3697,7 +3693,7 @@ where
|
||||||
.rev()
|
.rev()
|
||||||
{
|
{
|
||||||
match diff {
|
match diff {
|
||||||
SessionHistoryDiff::BrowsingContextDiff {
|
SessionHistoryDiff::BrowsingContext {
|
||||||
browsing_context_id,
|
browsing_context_id,
|
||||||
ref new_reloader,
|
ref new_reloader,
|
||||||
..
|
..
|
||||||
|
@ -3705,7 +3701,7 @@ where
|
||||||
browsing_context_changes
|
browsing_context_changes
|
||||||
.insert(browsing_context_id, new_reloader.clone());
|
.insert(browsing_context_id, new_reloader.clone());
|
||||||
},
|
},
|
||||||
SessionHistoryDiff::PipelineDiff {
|
SessionHistoryDiff::Pipeline {
|
||||||
ref pipeline_reloader,
|
ref pipeline_reloader,
|
||||||
new_history_state_id,
|
new_history_state_id,
|
||||||
ref new_url,
|
ref new_url,
|
||||||
|
@ -3721,7 +3717,7 @@ where
|
||||||
url_to_load.insert(pipeline_id, new_url.clone());
|
url_to_load.insert(pipeline_id, new_url.clone());
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
SessionHistoryDiff::HashDiff {
|
SessionHistoryDiff::Hash {
|
||||||
ref pipeline_reloader,
|
ref pipeline_reloader,
|
||||||
ref new_url,
|
ref new_url,
|
||||||
..
|
..
|
||||||
|
@ -3749,7 +3745,7 @@ where
|
||||||
|
|
||||||
for diff in session_history.past.drain(past_length - back..).rev() {
|
for diff in session_history.past.drain(past_length - back..).rev() {
|
||||||
match diff {
|
match diff {
|
||||||
SessionHistoryDiff::BrowsingContextDiff {
|
SessionHistoryDiff::BrowsingContext {
|
||||||
browsing_context_id,
|
browsing_context_id,
|
||||||
ref old_reloader,
|
ref old_reloader,
|
||||||
..
|
..
|
||||||
|
@ -3757,7 +3753,7 @@ where
|
||||||
browsing_context_changes
|
browsing_context_changes
|
||||||
.insert(browsing_context_id, old_reloader.clone());
|
.insert(browsing_context_id, old_reloader.clone());
|
||||||
},
|
},
|
||||||
SessionHistoryDiff::PipelineDiff {
|
SessionHistoryDiff::Pipeline {
|
||||||
ref pipeline_reloader,
|
ref pipeline_reloader,
|
||||||
old_history_state_id,
|
old_history_state_id,
|
||||||
ref old_url,
|
ref old_url,
|
||||||
|
@ -3773,7 +3769,7 @@ where
|
||||||
url_to_load.insert(pipeline_id, old_url.clone());
|
url_to_load.insert(pipeline_id, old_url.clone());
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
SessionHistoryDiff::HashDiff {
|
SessionHistoryDiff::Hash {
|
||||||
ref pipeline_reloader,
|
ref pipeline_reloader,
|
||||||
ref old_url,
|
ref old_url,
|
||||||
..
|
..
|
||||||
|
@ -4004,7 +4000,7 @@ where
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let diff = SessionHistoryDiff::PipelineDiff {
|
let diff = SessionHistoryDiff::Pipeline {
|
||||||
pipeline_reloader: NeedsToReload::No(pipeline_id),
|
pipeline_reloader: NeedsToReload::No(pipeline_id),
|
||||||
new_history_state_id: history_state_id,
|
new_history_state_id: history_state_id,
|
||||||
new_url: url,
|
new_url: url,
|
||||||
|
@ -4439,7 +4435,7 @@ where
|
||||||
CompositorEvent::KeyboardEvent(event),
|
CompositorEvent::KeyboardEvent(event),
|
||||||
);
|
);
|
||||||
if let Err(e) = event_loop.send(control_msg) {
|
if let Err(e) = event_loop.send(control_msg) {
|
||||||
return self.handle_send_error(pipeline_id, e);
|
self.handle_send_error(pipeline_id, e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
WebDriverCommandMsg::MouseButtonAction(mouse_event_type, mouse_button, x, y) => {
|
WebDriverCommandMsg::MouseButtonAction(mouse_event_type, mouse_button, x, y) => {
|
||||||
|
@ -4475,9 +4471,9 @@ where
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
match self.pipelines.get(&pipeline_id) {
|
match self.pipelines.get(&pipeline_id) {
|
||||||
None => return warn!("{pipeline_id}: Tried to notify visibility after closure"),
|
None => warn!("{pipeline_id}: Tried to notify visibility after closure"),
|
||||||
Some(pipeline) => pipeline.notify_visibility(visible),
|
Some(pipeline) => pipeline.notify_visibility(visible),
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn notify_history_changed(&self, top_level_browsing_context_id: TopLevelBrowsingContextId) {
|
fn notify_history_changed(&self, top_level_browsing_context_id: TopLevelBrowsingContextId) {
|
||||||
|
@ -4518,7 +4514,7 @@ where
|
||||||
// is the LoadData of the parent browsing context.
|
// is the LoadData of the parent browsing context.
|
||||||
let resolve_load_data_future =
|
let resolve_load_data_future =
|
||||||
|previous_load_data: &mut LoadData, diff: &SessionHistoryDiff| match *diff {
|
|previous_load_data: &mut LoadData, diff: &SessionHistoryDiff| match *diff {
|
||||||
SessionHistoryDiff::BrowsingContextDiff {
|
SessionHistoryDiff::BrowsingContext {
|
||||||
browsing_context_id,
|
browsing_context_id,
|
||||||
ref new_reloader,
|
ref new_reloader,
|
||||||
..
|
..
|
||||||
|
@ -4544,7 +4540,7 @@ where
|
||||||
|
|
||||||
let resolve_load_data_past =
|
let resolve_load_data_past =
|
||||||
|previous_load_data: &mut LoadData, diff: &SessionHistoryDiff| match *diff {
|
|previous_load_data: &mut LoadData, diff: &SessionHistoryDiff| match *diff {
|
||||||
SessionHistoryDiff::BrowsingContextDiff {
|
SessionHistoryDiff::BrowsingContext {
|
||||||
browsing_context_id,
|
browsing_context_id,
|
||||||
ref old_reloader,
|
ref old_reloader,
|
||||||
..
|
..
|
||||||
|
@ -4698,7 +4694,7 @@ where
|
||||||
NeedsToReload::Yes(..) => (None, None),
|
NeedsToReload::Yes(..) => (None, None),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let diff = SessionHistoryDiff::BrowsingContextDiff {
|
let diff = SessionHistoryDiff::BrowsingContext {
|
||||||
browsing_context_id: change.browsing_context_id,
|
browsing_context_id: change.browsing_context_id,
|
||||||
new_reloader: NeedsToReload::No(change.new_pipeline_id),
|
new_reloader: NeedsToReload::No(change.new_pipeline_id),
|
||||||
old_reloader: NeedsToReload::No(old_pipeline_id),
|
old_reloader: NeedsToReload::No(old_pipeline_id),
|
||||||
|
@ -4713,12 +4709,12 @@ where
|
||||||
|
|
||||||
for diff in diffs_to_close {
|
for diff in diffs_to_close {
|
||||||
match diff {
|
match diff {
|
||||||
SessionHistoryDiff::BrowsingContextDiff { new_reloader, .. } => {
|
SessionHistoryDiff::BrowsingContext { new_reloader, .. } => {
|
||||||
if let Some(pipeline_id) = new_reloader.alive_pipeline_id() {
|
if let Some(pipeline_id) = new_reloader.alive_pipeline_id() {
|
||||||
pipelines_to_close.push(pipeline_id);
|
pipelines_to_close.push(pipeline_id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SessionHistoryDiff::PipelineDiff {
|
SessionHistoryDiff::Pipeline {
|
||||||
pipeline_reloader,
|
pipeline_reloader,
|
||||||
new_history_state_id,
|
new_history_state_id,
|
||||||
..
|
..
|
||||||
|
@ -4807,7 +4803,7 @@ where
|
||||||
.rev()
|
.rev()
|
||||||
.map(|diff| diff.alive_old_pipeline())
|
.map(|diff| diff.alive_old_pipeline())
|
||||||
.skip(history_length)
|
.skip(history_length)
|
||||||
.filter_map(|maybe_pipeline| maybe_pipeline)
|
.flatten()
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
// The future is stored with oldest entries front, so we must
|
// The future is stored with oldest entries front, so we must
|
||||||
|
@ -4819,7 +4815,7 @@ where
|
||||||
.rev()
|
.rev()
|
||||||
.map(|diff| diff.alive_new_pipeline())
|
.map(|diff| diff.alive_new_pipeline())
|
||||||
.skip(history_length)
|
.skip(history_length)
|
||||||
.filter_map(|maybe_pipeline| maybe_pipeline),
|
.flatten(),
|
||||||
);
|
);
|
||||||
|
|
||||||
pipelines_to_evict
|
pipelines_to_evict
|
||||||
|
@ -5088,7 +5084,7 @@ where
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|pipeline_id| **pipeline_id != pipeline.id);
|
.filter(|pipeline_id| **pipeline_id != pipeline.id);
|
||||||
for id in pipeline_ids {
|
for id in pipeline_ids {
|
||||||
if let Some(pipeline) = self.pipelines.get(&id) {
|
if let Some(pipeline) = self.pipelines.get(id) {
|
||||||
let _ = pipeline
|
let _ = pipeline
|
||||||
.event_loop
|
.event_loop
|
||||||
.send(ConstellationControlMsg::ResizeInactive(
|
.send(ConstellationControlMsg::ResizeInactive(
|
||||||
|
|
|
@ -31,7 +31,7 @@ impl EventLoop {
|
||||||
/// Create a new event loop from the channel to its script thread.
|
/// Create a new event loop from the channel to its script thread.
|
||||||
pub fn new(script_chan: IpcSender<ConstellationControlMsg>) -> Rc<EventLoop> {
|
pub fn new(script_chan: IpcSender<ConstellationControlMsg>) -> Rc<EventLoop> {
|
||||||
Rc::new(EventLoop {
|
Rc::new(EventLoop {
|
||||||
script_chan: script_chan,
|
script_chan,
|
||||||
dont_send_or_sync: PhantomData,
|
dont_send_or_sync: PhantomData,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ impl NetworkListener {
|
||||||
request_builder: self.request_builder.clone(),
|
request_builder: self.request_builder.clone(),
|
||||||
resource_threads: self.resource_threads.clone(),
|
resource_threads: self.resource_threads.clone(),
|
||||||
sender: self.sender.clone(),
|
sender: self.sender.clone(),
|
||||||
pipeline_id: self.pipeline_id.clone(),
|
pipeline_id: self.pipeline_id,
|
||||||
should_send: false,
|
should_send: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ impl NetworkListener {
|
||||||
self.request_builder.referrer = metadata
|
self.request_builder.referrer = metadata
|
||||||
.referrer
|
.referrer
|
||||||
.clone()
|
.clone()
|
||||||
.map(|referrer_url| Referrer::ReferrerUrl(referrer_url))
|
.map(Referrer::ReferrerUrl)
|
||||||
.unwrap_or(Referrer::NoReferrer);
|
.unwrap_or(Referrer::NoReferrer);
|
||||||
self.request_builder.referrer_policy = metadata.referrer_policy;
|
self.request_builder.referrer_policy = metadata.referrer_policy;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#![allow(clippy::too_many_arguments)]
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
@ -291,7 +293,7 @@ impl Pipeline {
|
||||||
layout_to_constellation_chan: state.layout_to_constellation_chan,
|
layout_to_constellation_chan: state.layout_to_constellation_chan,
|
||||||
script_chan: script_chan.clone(),
|
script_chan: script_chan.clone(),
|
||||||
load_data: state.load_data.clone(),
|
load_data: state.load_data.clone(),
|
||||||
script_port: script_port,
|
script_port,
|
||||||
opts: (*opts::get()).clone(),
|
opts: (*opts::get()).clone(),
|
||||||
prefs: prefs::pref_map().iter().collect(),
|
prefs: prefs::pref_map().iter().collect(),
|
||||||
pipeline_namespace_id: state.pipeline_namespace_id,
|
pipeline_namespace_id: state.pipeline_namespace_id,
|
||||||
|
@ -311,7 +313,7 @@ impl Pipeline {
|
||||||
let (bhm_control_chan, bhm_control_port) =
|
let (bhm_control_chan, bhm_control_port) =
|
||||||
ipc::channel().expect("Sampler chan");
|
ipc::channel().expect("Sampler chan");
|
||||||
unprivileged_pipeline_content.bhm_control_port = Some(bhm_control_port);
|
unprivileged_pipeline_content.bhm_control_port = Some(bhm_control_port);
|
||||||
let _ = unprivileged_pipeline_content.spawn_multiprocess()?;
|
unprivileged_pipeline_content.spawn_multiprocess()?;
|
||||||
Some(bhm_control_chan)
|
Some(bhm_control_chan)
|
||||||
} else {
|
} else {
|
||||||
// Should not be None in single-process mode.
|
// Should not be None in single-process mode.
|
||||||
|
@ -358,16 +360,16 @@ impl Pipeline {
|
||||||
load_data: LoadData,
|
load_data: LoadData,
|
||||||
) -> Pipeline {
|
) -> Pipeline {
|
||||||
let pipeline = Pipeline {
|
let pipeline = Pipeline {
|
||||||
id: id,
|
id,
|
||||||
browsing_context_id: browsing_context_id,
|
browsing_context_id,
|
||||||
top_level_browsing_context_id: top_level_browsing_context_id,
|
top_level_browsing_context_id,
|
||||||
opener: opener,
|
opener,
|
||||||
event_loop: event_loop,
|
event_loop,
|
||||||
compositor_proxy: compositor_proxy,
|
compositor_proxy,
|
||||||
url: load_data.url.clone(),
|
url: load_data.url.clone(),
|
||||||
children: vec![],
|
children: vec![],
|
||||||
animation_state: AnimationState::NoAnimationsPresent,
|
animation_state: AnimationState::NoAnimationsPresent,
|
||||||
load_data: load_data,
|
load_data,
|
||||||
history_state_id: None,
|
history_state_id: None,
|
||||||
history_states: HashSet::new(),
|
history_states: HashSet::new(),
|
||||||
completely_loaded: false,
|
completely_loaded: false,
|
||||||
|
@ -426,8 +428,8 @@ impl Pipeline {
|
||||||
/// The compositor's view of a pipeline.
|
/// The compositor's view of a pipeline.
|
||||||
pub fn to_sendable(&self) -> CompositionPipeline {
|
pub fn to_sendable(&self) -> CompositionPipeline {
|
||||||
CompositionPipeline {
|
CompositionPipeline {
|
||||||
id: self.id.clone(),
|
id: self.id,
|
||||||
top_level_browsing_context_id: self.top_level_browsing_context_id.clone(),
|
top_level_browsing_context_id: self.top_level_browsing_context_id,
|
||||||
script_chan: self.event_loop.sender(),
|
script_chan: self.event_loop.sender(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -445,13 +447,15 @@ impl Pipeline {
|
||||||
.position(|id| *id == browsing_context_id)
|
.position(|id| *id == browsing_context_id)
|
||||||
{
|
{
|
||||||
None => {
|
None => {
|
||||||
return warn!(
|
warn!(
|
||||||
"Pipeline remove child already removed ({:?}).",
|
"Pipeline remove child already removed ({:?}).",
|
||||||
browsing_context_id
|
browsing_context_id
|
||||||
);
|
)
|
||||||
},
|
},
|
||||||
Some(index) => self.children.remove(index),
|
Some(index) => {
|
||||||
};
|
self.children.remove(index);
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Notify the script thread that this pipeline is visible.
|
/// Notify the script thread that this pipeline is visible.
|
||||||
|
@ -539,13 +543,13 @@ impl UnprivilegedPipelineContent {
|
||||||
devtools_chan: self.devtools_ipc_sender,
|
devtools_chan: self.devtools_ipc_sender,
|
||||||
window_size: self.window_size,
|
window_size: self.window_size,
|
||||||
pipeline_namespace_id: self.pipeline_namespace_id,
|
pipeline_namespace_id: self.pipeline_namespace_id,
|
||||||
content_process_shutdown_chan: content_process_shutdown_chan,
|
content_process_shutdown_chan,
|
||||||
webgl_chan: self.webgl_chan,
|
webgl_chan: self.webgl_chan,
|
||||||
webxr_registry: self.webxr_registry,
|
webxr_registry: self.webxr_registry,
|
||||||
webrender_document: self.webrender_document,
|
webrender_document: self.webrender_document,
|
||||||
webrender_api_sender: self.webrender_api_sender.clone(),
|
webrender_api_sender: self.webrender_api_sender.clone(),
|
||||||
player_context: self.player_context.clone(),
|
player_context: self.player_context.clone(),
|
||||||
inherited_secure_context: self.load_data.inherited_secure_context.clone(),
|
inherited_secure_context: self.load_data.inherited_secure_context,
|
||||||
},
|
},
|
||||||
layout_factory,
|
layout_factory,
|
||||||
self.font_cache_thread.clone(),
|
self.font_cache_thread.clone(),
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use std::cmp::PartialEq;
|
use std::cmp::PartialEq;
|
||||||
use std::{fmt, mem};
|
use std::fmt;
|
||||||
|
|
||||||
use euclid::Size2D;
|
use euclid::Size2D;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
|
@ -44,7 +44,7 @@ impl JointSessionHistory {
|
||||||
pub fn push_diff(&mut self, diff: SessionHistoryDiff) -> Vec<SessionHistoryDiff> {
|
pub fn push_diff(&mut self, diff: SessionHistoryDiff) -> Vec<SessionHistoryDiff> {
|
||||||
debug!("pushing a past entry; removing future");
|
debug!("pushing a past entry; removing future");
|
||||||
self.past.push(diff);
|
self.past.push(diff);
|
||||||
mem::replace(&mut self.future, vec![])
|
std::mem::take(&mut self.future)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn replace_reloader(&mut self, old_reloader: NeedsToReload, new_reloader: NeedsToReload) {
|
pub fn replace_reloader(&mut self, old_reloader: NeedsToReload, new_reloader: NeedsToReload) {
|
||||||
|
@ -59,12 +59,12 @@ impl JointSessionHistory {
|
||||||
history_state_id: HistoryStateId,
|
history_state_id: HistoryStateId,
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
) {
|
) {
|
||||||
if let Some(SessionHistoryDiff::PipelineDiff {
|
if let Some(SessionHistoryDiff::Pipeline {
|
||||||
ref mut new_history_state_id,
|
ref mut new_history_state_id,
|
||||||
ref mut new_url,
|
ref mut new_url,
|
||||||
..
|
..
|
||||||
}) = self.past.iter_mut().find(|diff| match diff {
|
}) = self.past.iter_mut().find(|diff| match diff {
|
||||||
SessionHistoryDiff::PipelineDiff {
|
SessionHistoryDiff::Pipeline {
|
||||||
pipeline_reloader: NeedsToReload::No(id),
|
pipeline_reloader: NeedsToReload::No(id),
|
||||||
..
|
..
|
||||||
} => pipeline_id == *id,
|
} => pipeline_id == *id,
|
||||||
|
@ -74,12 +74,12 @@ impl JointSessionHistory {
|
||||||
*new_url = url.clone();
|
*new_url = url.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(SessionHistoryDiff::PipelineDiff {
|
if let Some(SessionHistoryDiff::Pipeline {
|
||||||
ref mut old_history_state_id,
|
ref mut old_history_state_id,
|
||||||
ref mut old_url,
|
ref mut old_url,
|
||||||
..
|
..
|
||||||
}) = self.future.iter_mut().find(|diff| match diff {
|
}) = self.future.iter_mut().find(|diff| match diff {
|
||||||
SessionHistoryDiff::PipelineDiff {
|
SessionHistoryDiff::Pipeline {
|
||||||
pipeline_reloader: NeedsToReload::No(id),
|
pipeline_reloader: NeedsToReload::No(id),
|
||||||
..
|
..
|
||||||
} => pipeline_id == *id,
|
} => pipeline_id == *id,
|
||||||
|
@ -93,14 +93,14 @@ impl JointSessionHistory {
|
||||||
pub fn remove_entries_for_browsing_context(&mut self, context_id: BrowsingContextId) {
|
pub fn remove_entries_for_browsing_context(&mut self, context_id: BrowsingContextId) {
|
||||||
debug!("{}: Removing entries for browsing context", context_id);
|
debug!("{}: Removing entries for browsing context", context_id);
|
||||||
self.past.retain(|diff| match diff {
|
self.past.retain(|diff| match diff {
|
||||||
SessionHistoryDiff::BrowsingContextDiff {
|
SessionHistoryDiff::BrowsingContext {
|
||||||
browsing_context_id,
|
browsing_context_id,
|
||||||
..
|
..
|
||||||
} => *browsing_context_id != context_id,
|
} => *browsing_context_id != context_id,
|
||||||
_ => true,
|
_ => true,
|
||||||
});
|
});
|
||||||
self.future.retain(|diff| match diff {
|
self.future.retain(|diff| match diff {
|
||||||
SessionHistoryDiff::BrowsingContextDiff {
|
SessionHistoryDiff::BrowsingContext {
|
||||||
browsing_context_id,
|
browsing_context_id,
|
||||||
..
|
..
|
||||||
} => *browsing_context_id != context_id,
|
} => *browsing_context_id != context_id,
|
||||||
|
@ -180,7 +180,7 @@ impl PartialEq for NeedsToReload {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum SessionHistoryDiff {
|
pub enum SessionHistoryDiff {
|
||||||
/// Represents a diff where the active pipeline of an entry changed.
|
/// Represents a diff where the active pipeline of an entry changed.
|
||||||
BrowsingContextDiff {
|
BrowsingContext {
|
||||||
/// The browsing context whose pipeline changed
|
/// The browsing context whose pipeline changed
|
||||||
browsing_context_id: BrowsingContextId,
|
browsing_context_id: BrowsingContextId,
|
||||||
/// The previous pipeline (used when traversing into the past)
|
/// The previous pipeline (used when traversing into the past)
|
||||||
|
@ -189,7 +189,7 @@ pub enum SessionHistoryDiff {
|
||||||
new_reloader: NeedsToReload,
|
new_reloader: NeedsToReload,
|
||||||
},
|
},
|
||||||
/// Represents a diff where the active state of a pipeline changed.
|
/// Represents a diff where the active state of a pipeline changed.
|
||||||
PipelineDiff {
|
Pipeline {
|
||||||
/// The pipeline whose history state changed.
|
/// The pipeline whose history state changed.
|
||||||
pipeline_reloader: NeedsToReload,
|
pipeline_reloader: NeedsToReload,
|
||||||
/// The old history state id.
|
/// The old history state id.
|
||||||
|
@ -201,7 +201,7 @@ pub enum SessionHistoryDiff {
|
||||||
/// The new url
|
/// The new url
|
||||||
new_url: ServoUrl,
|
new_url: ServoUrl,
|
||||||
},
|
},
|
||||||
HashDiff {
|
Hash {
|
||||||
pipeline_reloader: NeedsToReload,
|
pipeline_reloader: NeedsToReload,
|
||||||
old_url: ServoUrl,
|
old_url: ServoUrl,
|
||||||
new_url: ServoUrl,
|
new_url: ServoUrl,
|
||||||
|
@ -212,7 +212,7 @@ impl SessionHistoryDiff {
|
||||||
/// Returns the old pipeline id if that pipeline is still alive, otherwise returns `None`
|
/// Returns the old pipeline id if that pipeline is still alive, otherwise returns `None`
|
||||||
pub fn alive_old_pipeline(&self) -> Option<PipelineId> {
|
pub fn alive_old_pipeline(&self) -> Option<PipelineId> {
|
||||||
match *self {
|
match *self {
|
||||||
SessionHistoryDiff::BrowsingContextDiff {
|
SessionHistoryDiff::BrowsingContext {
|
||||||
ref old_reloader, ..
|
ref old_reloader, ..
|
||||||
} => match *old_reloader {
|
} => match *old_reloader {
|
||||||
NeedsToReload::No(pipeline_id) => Some(pipeline_id),
|
NeedsToReload::No(pipeline_id) => Some(pipeline_id),
|
||||||
|
@ -225,7 +225,7 @@ impl SessionHistoryDiff {
|
||||||
/// Returns the new pipeline id if that pipeline is still alive, otherwise returns `None`
|
/// Returns the new pipeline id if that pipeline is still alive, otherwise returns `None`
|
||||||
pub fn alive_new_pipeline(&self) -> Option<PipelineId> {
|
pub fn alive_new_pipeline(&self) -> Option<PipelineId> {
|
||||||
match *self {
|
match *self {
|
||||||
SessionHistoryDiff::BrowsingContextDiff {
|
SessionHistoryDiff::BrowsingContext {
|
||||||
ref new_reloader, ..
|
ref new_reloader, ..
|
||||||
} => match *new_reloader {
|
} => match *new_reloader {
|
||||||
NeedsToReload::No(pipeline_id) => Some(pipeline_id),
|
NeedsToReload::No(pipeline_id) => Some(pipeline_id),
|
||||||
|
@ -242,7 +242,7 @@ impl SessionHistoryDiff {
|
||||||
reloader: &NeedsToReload,
|
reloader: &NeedsToReload,
|
||||||
) {
|
) {
|
||||||
match *self {
|
match *self {
|
||||||
SessionHistoryDiff::BrowsingContextDiff {
|
SessionHistoryDiff::BrowsingContext {
|
||||||
ref mut old_reloader,
|
ref mut old_reloader,
|
||||||
ref mut new_reloader,
|
ref mut new_reloader,
|
||||||
..
|
..
|
||||||
|
@ -254,7 +254,7 @@ impl SessionHistoryDiff {
|
||||||
*new_reloader = reloader.clone();
|
*new_reloader = reloader.clone();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SessionHistoryDiff::PipelineDiff {
|
SessionHistoryDiff::Pipeline {
|
||||||
ref mut pipeline_reloader,
|
ref mut pipeline_reloader,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
|
@ -262,7 +262,7 @@ impl SessionHistoryDiff {
|
||||||
*pipeline_reloader = reloader.clone();
|
*pipeline_reloader = reloader.clone();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SessionHistoryDiff::HashDiff {
|
SessionHistoryDiff::Hash {
|
||||||
ref mut pipeline_reloader,
|
ref mut pipeline_reloader,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
|
|
|
@ -30,7 +30,7 @@ impl PartialOrd for ScheduledEvent {
|
||||||
impl Eq for ScheduledEvent {}
|
impl Eq for ScheduledEvent {}
|
||||||
impl PartialEq for ScheduledEvent {
|
impl PartialEq for ScheduledEvent {
|
||||||
fn eq(&self, other: &ScheduledEvent) -> bool {
|
fn eq(&self, other: &ScheduledEvent) -> bool {
|
||||||
self as *const ScheduledEvent == other as *const ScheduledEvent
|
std::ptr::eq(self, other)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue