mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update rustfmt to the 2024 style edition (#35764)
* Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
6300e820b4
commit
3d320fa96a
603 changed files with 1739 additions and 1648 deletions
|
@ -97,21 +97,21 @@ use background_hang_monitor::HangMonitorRegister;
|
|||
use background_hang_monitor_api::{
|
||||
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, HangMonitorAlert,
|
||||
};
|
||||
use base::Epoch;
|
||||
use base::id::{
|
||||
BroadcastChannelRouterId, BrowsingContextGroupId, BrowsingContextId, HistoryStateId,
|
||||
MessagePortId, MessagePortRouterId, PipelineId, PipelineNamespace, PipelineNamespaceId,
|
||||
PipelineNamespaceRequest, TopLevelBrowsingContextId, WebViewId,
|
||||
};
|
||||
use base::Epoch;
|
||||
#[cfg(feature = "bluetooth")]
|
||||
use bluetooth_traits::BluetoothRequest;
|
||||
use canvas_traits::ConstellationCanvasMsg;
|
||||
use canvas_traits::canvas::{CanvasId, CanvasMsg};
|
||||
use canvas_traits::webgl::WebGLThreads;
|
||||
use canvas_traits::ConstellationCanvasMsg;
|
||||
use compositing_traits::{
|
||||
CompositorMsg, CompositorProxy, ConstellationMsg as FromCompositorMsg, SendableFrameTree,
|
||||
};
|
||||
use crossbeam_channel::{select, unbounded, Receiver, Sender};
|
||||
use crossbeam_channel::{Receiver, Sender, select, unbounded};
|
||||
use devtools_traits::{
|
||||
ChromeToDevtoolsControlMsg, DevtoolsControlMsg, DevtoolsPageInfo, NavigationState,
|
||||
ScriptToDevtoolsControlMsg,
|
||||
|
@ -122,12 +122,12 @@ use embedder_traits::{
|
|||
MediaSessionEvent, MediaSessionPlaybackState, MouseButton, MouseButtonAction, MouseButtonEvent,
|
||||
Theme, TraversalDirection, WebDriverCommandMsg, WebDriverLoadStatus,
|
||||
};
|
||||
use euclid::default::Size2D as UntypedSize2D;
|
||||
use euclid::Size2D;
|
||||
use euclid::default::Size2D as UntypedSize2D;
|
||||
use fonts::SystemFontServiceProxy;
|
||||
use ipc_channel::Error as IpcError;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use ipc_channel::Error as IpcError;
|
||||
use keyboard_types::webdriver::Event as WebDriverInputEvent;
|
||||
use log::{debug, error, info, trace, warn};
|
||||
use media::WindowGLContext;
|
||||
|
@ -149,7 +149,7 @@ use script_traits::{
|
|||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::{opts, pref};
|
||||
use servo_rand::{random, Rng, ServoRng, SliceRandom};
|
||||
use servo_rand::{Rng, ServoRng, SliceRandom, random};
|
||||
use servo_url::{Host, ImmutableOrigin, ServoUrl};
|
||||
use style_traits::CSSPixel;
|
||||
#[cfg(feature = "webgpu")]
|
||||
|
@ -2027,7 +2027,9 @@ where
|
|||
Some(router_id) => router_id,
|
||||
None => {
|
||||
if !ports.is_empty() {
|
||||
warn!("Constellation unable to process port transfer successes, since no router id was received");
|
||||
warn!(
|
||||
"Constellation unable to process port transfer successes, since no router id was received"
|
||||
);
|
||||
}
|
||||
return;
|
||||
},
|
||||
|
@ -2251,7 +2253,7 @@ where
|
|||
return warn!(
|
||||
"Constellation asked to re-route msg to unknown messageport {:?}",
|
||||
port_id
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
match &mut info.state {
|
||||
|
@ -2357,14 +2359,16 @@ where
|
|||
return warn!(
|
||||
"Constellation asked to remove unknown entangled messageport {:?}",
|
||||
entangled_id
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
let router_id = match info.state {
|
||||
TransferState::EntangledRemoved => return warn!(
|
||||
"Constellation asked to remove entangled messageport by a port that was already removed {:?}",
|
||||
port_id
|
||||
),
|
||||
TransferState::EntangledRemoved => {
|
||||
return warn!(
|
||||
"Constellation asked to remove entangled messageport by a port that was already removed {:?}",
|
||||
port_id
|
||||
);
|
||||
},
|
||||
TransferState::TransferInProgress(_) |
|
||||
TransferState::CompletionInProgress(_) |
|
||||
TransferState::CompletionFailed(_) |
|
||||
|
@ -2826,7 +2830,9 @@ where
|
|||
)]
|
||||
fn handle_focus_web_view(&mut self, top_level_browsing_context_id: TopLevelBrowsingContextId) {
|
||||
if self.webviews.get(top_level_browsing_context_id).is_none() {
|
||||
return warn!("{top_level_browsing_context_id}: FocusWebView on unknown top-level browsing context");
|
||||
return warn!(
|
||||
"{top_level_browsing_context_id}: FocusWebView on unknown top-level browsing context"
|
||||
);
|
||||
}
|
||||
self.webviews.focus(top_level_browsing_context_id);
|
||||
self.embedder_proxy
|
||||
|
@ -3223,7 +3229,9 @@ where
|
|||
// TODO(servo#30571) revert to debug_assert_eq!() once underlying bug is fixed
|
||||
#[cfg(debug_assertions)]
|
||||
if !(browsing_context_size == load_info.window_size.initial_viewport) {
|
||||
log::warn!("debug assertion failed! browsing_context_size == load_info.window_size.initial_viewport");
|
||||
log::warn!(
|
||||
"debug assertion failed! browsing_context_size == load_info.window_size.initial_viewport"
|
||||
);
|
||||
}
|
||||
|
||||
// Create the new pipeline, attached to the parent and push to pending changes
|
||||
|
@ -3271,7 +3279,7 @@ where
|
|||
return warn!(
|
||||
"{}: Script loaded url in closed iframe pipeline",
|
||||
parent_pipeline_id
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
let (is_parent_private, is_parent_throttled, is_parent_secure) =
|
||||
|
@ -4356,7 +4364,7 @@ where
|
|||
return warn!(
|
||||
"{}: Visibility change for closed browsing context",
|
||||
pipeline_id
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
let parent_pipeline_id = match self.browsing_contexts.get(&browsing_context_id) {
|
||||
|
@ -5118,8 +5126,7 @@ where
|
|||
let pipeline_id = browsing_context.pipeline_id;
|
||||
trace!(
|
||||
"{}: Checking readiness of {}",
|
||||
browsing_context.id,
|
||||
pipeline_id
|
||||
browsing_context.id, pipeline_id
|
||||
);
|
||||
|
||||
let pipeline = match self.pipelines.get(&pipeline_id) {
|
||||
|
@ -5319,7 +5326,7 @@ where
|
|||
return warn!(
|
||||
"{}: Switched from fullscreen mode after closing",
|
||||
pipeline_id
|
||||
)
|
||||
);
|
||||
},
|
||||
Some(pipeline) => pipeline,
|
||||
};
|
||||
|
@ -5637,7 +5644,7 @@ where
|
|||
return warn!(
|
||||
"{}: Got media session action request after closure",
|
||||
media_session_pipeline_id,
|
||||
)
|
||||
);
|
||||
},
|
||||
Some(pipeline) => {
|
||||
let msg =
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
use std::marker::PhantomData;
|
||||
use std::rc::Rc;
|
||||
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use ipc_channel::Error;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use script_traits::ScriptThreadMessage;
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#event-loop>
|
||||
|
|
|
@ -20,4 +20,4 @@ mod webview;
|
|||
pub use crate::constellation::{Constellation, InitialConstellationState};
|
||||
pub use crate::logging::{FromCompositorLogger, FromScriptLogger};
|
||||
pub use crate::pipeline::UnprivilegedPipelineContent;
|
||||
pub use crate::sandboxing::{content_process_sandbox_profile, UnprivilegedContent};
|
||||
pub use crate::sandboxing::{UnprivilegedContent, content_process_sandbox_profile};
|
||||
|
|
|
@ -11,26 +11,26 @@ use background_hang_monitor::HangMonitorRegister;
|
|||
use background_hang_monitor_api::{
|
||||
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, HangMonitorAlert,
|
||||
};
|
||||
use base::Epoch;
|
||||
use base::id::{
|
||||
BrowsingContextId, HistoryStateId, PipelineId, PipelineNamespace, PipelineNamespaceId,
|
||||
PipelineNamespaceRequest, TopLevelBrowsingContextId,
|
||||
};
|
||||
use base::Epoch;
|
||||
#[cfg(feature = "bluetooth")]
|
||||
use bluetooth_traits::BluetoothRequest;
|
||||
use canvas_traits::webgl::WebGLPipeline;
|
||||
use compositing_traits::{CompositionPipeline, CompositorMsg, CompositorProxy};
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use crossbeam_channel::{Sender, unbounded};
|
||||
use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg};
|
||||
use fonts::{SystemFontServiceProxy, SystemFontServiceProxySender};
|
||||
use ipc_channel::Error;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use ipc_channel::Error;
|
||||
use log::{debug, error, warn};
|
||||
use media::WindowGLContext;
|
||||
use net::image_cache::ImageCacheImpl;
|
||||
use net_traits::image_cache::ImageCache;
|
||||
use net_traits::ResourceThreads;
|
||||
use net_traits::image_cache::ImageCache;
|
||||
use profile_traits::{mem as profile_mem, time};
|
||||
use script_layout_interface::{LayoutFactory, ScriptThreadFactory};
|
||||
use script_traits::{
|
||||
|
@ -46,7 +46,7 @@ use webrender_api::DocumentId;
|
|||
use webrender_traits::CrossProcessCompositorApi;
|
||||
|
||||
use crate::event_loop::EventLoop;
|
||||
use crate::sandboxing::{spawn_multiprocess, UnprivilegedContent};
|
||||
use crate::sandboxing::{UnprivilegedContent, spawn_multiprocess};
|
||||
|
||||
/// 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.
|
||||
|
|
|
@ -10,7 +10,7 @@ use servo_config::prefs;
|
|||
use servo_config::prefs::Preferences;
|
||||
use servo_url::ImmutableOrigin;
|
||||
|
||||
use crate::sandboxing::{spawn_multiprocess, UnprivilegedContent};
|
||||
use crate::sandboxing::{UnprivilegedContent, spawn_multiprocess};
|
||||
|
||||
/// Conceptually, this is glue to start an agent-cluster for a service worker agent.
|
||||
/// <https://html.spec.whatwg.org/multipage/#obtain-a-service-worker-agent>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue