diff options
Diffstat (limited to 'components/script')
54 files changed, 68 insertions, 69 deletions
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 1fc2f1a69cc..45926d07f40 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -31,7 +31,9 @@ accountable-refcell = { workspace = true, optional = true } app_units = { workspace = true } arrayvec = { workspace = true } atomic_refcell = { workspace = true } +background_hang_monitor_api = { workspace = true } backtrace = { workspace = true } +base = { workspace = true } base64 = { workspace = true } bitflags = { workspace = true } bluetooth_traits = { workspace = true } @@ -74,7 +76,6 @@ media = { path = "../media" } metrics = { path = "../metrics" } mime = { workspace = true } mime_guess = { workspace = true } -msg = { workspace = true } net_traits = { workspace = true } num_cpus = { workspace = true } num-traits = { workspace = true } diff --git a/components/script/animations.rs b/components/script/animations.rs index 4edb20a92a8..45e88734e75 100644 --- a/components/script/animations.rs +++ b/components/script/animations.rs @@ -6,10 +6,10 @@ use std::cell::Cell; +use base::id::PipelineId; use cssparser::ToCss; use fxhash::{FxHashMap, FxHashSet}; use libc::c_void; -use msg::constellation_msg::PipelineId; use script_traits::{AnimationState as AnimationsPresentState, ScriptMsg, UntrustedNodeAddress}; use serde::{Deserialize, Serialize}; use style::animation::{ diff --git a/components/script/devtools.rs b/components/script/devtools.rs index d83e9fecdc6..1bb34ecdb7c 100644 --- a/components/script/devtools.rs +++ b/components/script/devtools.rs @@ -5,6 +5,7 @@ use std::rc::Rc; use std::str; +use base::id::PipelineId; use devtools_traits::{ AutoMargins, ComputedNodeLayout, EvaluateJSReply, Modification, NodeInfo, TimelineMarker, TimelineMarkerType, @@ -12,7 +13,6 @@ use devtools_traits::{ use ipc_channel::ipc::IpcSender; use js::jsval::UndefinedValue; use js::rust::ToString; -use msg::constellation_msg::PipelineId; use uuid::Uuid; use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods; diff --git a/components/script/dom/audiocontext.rs b/components/script/dom/audiocontext.rs index a82ff1e93a3..e3be006aced 100644 --- a/components/script/dom/audiocontext.rs +++ b/components/script/dom/audiocontext.rs @@ -4,9 +4,9 @@ use std::rc::Rc; +use base::id::PipelineId; use dom_struct::dom_struct; use js::rust::HandleObject; -use msg::constellation_msg::PipelineId; use servo_media::audio::context::{LatencyCategory, ProcessingState, RealTimeAudioContextOptions}; use crate::dom::baseaudiocontext::{BaseAudioContext, BaseAudioContextOptions}; diff --git a/components/script/dom/baseaudiocontext.rs b/components/script/dom/baseaudiocontext.rs index e47e2e02b95..e68534c5f76 100644 --- a/components/script/dom/baseaudiocontext.rs +++ b/components/script/dom/baseaudiocontext.rs @@ -8,10 +8,10 @@ use std::collections::{HashMap, VecDeque}; use std::rc::Rc; use std::sync::{Arc, Mutex}; +use base::id::PipelineId; use dom_struct::dom_struct; use js::rust::CustomAutoRooterGuard; use js::typedarray::ArrayBuffer; -use msg::constellation_msg::PipelineId; use servo_media::audio::context::{ AudioContext, AudioContextOptions, OfflineAudioContextOptions, ProcessingState, RealTimeAudioContextOptions, diff --git a/components/script/dom/bindings/structuredclone.rs b/components/script/dom/bindings/structuredclone.rs index 209a499ee59..d63299a5bab 100644 --- a/components/script/dom/bindings/structuredclone.rs +++ b/components/script/dom/bindings/structuredclone.rs @@ -8,6 +8,7 @@ use std::collections::HashMap; use std::os::raw; use std::ptr; +use base::id::{BlobId, MessagePortId}; use js::glue::{ CopyJSStructuredCloneData, DeleteJSAutoStructuredCloneBuffer, GetLengthOfJSStructuredCloneData, NewJSAutoStructuredCloneBuffer, WriteBytesToJSStructuredCloneData, @@ -22,7 +23,6 @@ use js::jsapi::{ use js::jsval::UndefinedValue; use js::rust::wrappers::{JS_ReadStructuredClone, JS_WriteStructuredClone}; use js::rust::{CustomAutoRooterGuard, HandleValue, MutableHandleValue}; -use msg::constellation_msg::{BlobId, MessagePortId}; use script_traits::serializable::BlobImpl; use script_traits::transferable::MessagePortImpl; use script_traits::StructuredSerializedData; diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 7cdb6384ed1..0cc13392f12 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -7,11 +7,11 @@ use std::num::NonZeroU32; use std::ptr::NonNull; use std::rc::Rc; +use base::id::{BlobId, BlobIndex, PipelineNamespaceId}; use dom_struct::dom_struct; use encoding_rs::UTF_8; use js::jsapi::JSObject; use js::rust::HandleObject; -use msg::constellation_msg::{BlobId, BlobIndex, PipelineNamespaceId}; use net_traits::filemanager_thread::RelativePos; use script_traits::serializable::BlobImpl; use uuid::Uuid; diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs index b8647c305ce..e340621af71 100644 --- a/components/script/dom/dedicatedworkerglobalscope.rs +++ b/components/script/dom/dedicatedworkerglobalscope.rs @@ -7,6 +7,7 @@ use std::sync::atomic::AtomicBool; use std::sync::Arc; use std::thread::{self, JoinHandle}; +use base::id::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId}; use crossbeam_channel::{unbounded, Receiver, Sender}; use devtools_traits::DevtoolScriptControlMsg; use dom_struct::dom_struct; @@ -15,7 +16,6 @@ use ipc_channel::router::ROUTER; use js::jsapi::{Heap, JSContext, JSObject, JS_AddInterruptCallback}; use js::jsval::UndefinedValue; use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue}; -use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId}; use net_traits::image_cache::ImageCache; use net_traits::request::{ CredentialsMode, Destination, ParserMetadata, Referrer, RequestBuilder, RequestMode, diff --git a/components/script/dom/dissimilaroriginwindow.rs b/components/script/dom/dissimilaroriginwindow.rs index ebe33bad95a..51cad369282 100644 --- a/components/script/dom/dissimilaroriginwindow.rs +++ b/components/script/dom/dissimilaroriginwindow.rs @@ -2,11 +2,11 @@ * 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/. */ +use base::id::PipelineId; use dom_struct::dom_struct; use js::jsapi::{Heap, JSObject}; use js::jsval::{JSVal, UndefinedValue}; use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue}; -use msg::constellation_msg::PipelineId; use script_traits::{ScriptMsg, StructuredSerializedData}; use servo_url::ServoUrl; diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index dc55761b02f..f58f9472958 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -13,6 +13,7 @@ use std::rc::Rc; use std::slice::from_ref; use std::time::{Duration, Instant}; +use base::id::BrowsingContextId; use canvas_traits::webgl::{self, WebGLContextId, WebGLMsg}; use content_security_policy::{self as csp, CspList}; use cookie::Cookie; @@ -33,7 +34,6 @@ use metrics::{ ProgressiveWebMetric, }; use mime::{self, Mime}; -use msg::constellation_msg::BrowsingContextId; use net_traits::pub_domains::is_pub_domain; use net_traits::request::RequestBuilder; use net_traits::response::HttpsState; diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 12dc2af872e..e91a24e2ddf 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -15,6 +15,7 @@ use std::{fmt, mem}; use cssparser::match_ignore_ascii_case; use devtools_traits::AttrInfo; use dom_struct::dom_struct; +use embedder_traits::InputMethodType; use euclid::default::{Rect, Size2D}; use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; use html5ever::serialize::{SerializeOpts, TraversalScope}; @@ -25,7 +26,6 @@ use html5ever::{ use js::jsapi::Heap; use js::jsval::JSVal; use js::rust::HandleObject; -use msg::constellation_msg::InputMethodType; use net_traits::request::CorsSettings; use net_traits::ReferrerPolicy; use script_layout_interface::ReflowGoal; diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs index 32febf8ab8e..7586a58793e 100644 --- a/components/script/dom/globalscope.rs +++ b/components/script/dom/globalscope.rs @@ -14,6 +14,10 @@ use std::thread::JoinHandle; use std::time::Instant; use std::{mem, ptr}; +use base::id::{ + BlobId, BroadcastChannelRouterId, MessagePortId, MessagePortRouterId, PipelineId, + ServiceWorkerId, ServiceWorkerRegistrationId, +}; use content_security_policy::CspList; use crossbeam_channel::Sender; use devtools_traits::{PageError, ScriptToDevtoolsControlMsg}; @@ -34,10 +38,6 @@ use js::rust::{ MutableHandleValue, ParentRuntime, Runtime, }; use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL}; -use msg::constellation_msg::{ - BlobId, BroadcastChannelRouterId, MessagePortId, MessagePortRouterId, PipelineId, - ServiceWorkerId, ServiceWorkerRegistrationId, -}; use net_traits::blob_url_store::{get_blob_origin, BlobBuf}; use net_traits::filemanager_thread::{ FileManagerResult, FileManagerThreadMsg, ReadFileProgress, RelativePos, diff --git a/components/script/dom/history.rs b/components/script/dom/history.rs index 15a02fa64c1..f0be9b8ceac 100644 --- a/components/script/dom/history.rs +++ b/components/script/dom/history.rs @@ -5,15 +5,15 @@ use std::cell::Cell; use std::cmp::Ordering; +use base::id::HistoryStateId; use dom_struct::dom_struct; use js::jsapi::Heap; use js::jsval::{JSVal, NullValue, UndefinedValue}; use js::rust::HandleValue; -use msg::constellation_msg::{HistoryStateId, TraversalDirection}; use net_traits::{CoreResourceMsg, IpcSend}; use profile_traits::ipc; use profile_traits::ipc::channel; -use script_traits::{ScriptMsg, StructuredSerializedData}; +use script_traits::{ScriptMsg, StructuredSerializedData, TraversalDirection}; use servo_url::ServoUrl; use crate::dom::bindings::codegen::Bindings::HistoryBinding::HistoryMethods; diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index cb84aa7bb52..0ccf0fa7661 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -4,11 +4,11 @@ use std::cell::Cell; +use base::id::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId}; use bitflags::bitflags; use dom_struct::dom_struct; use html5ever::{local_name, namespace_url, ns, LocalName, Prefix}; use js::rust::HandleObject; -use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId}; use profile_traits::ipc as ProfiledIpc; use script_layout_interface::ReflowGoal; use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed}; diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index d2bb0d57408..96d4b1183cd 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -9,6 +9,7 @@ use std::sync::{Arc, Mutex}; use std::{char, i32, mem}; use app_units::{Au, AU_PER_PX}; +use base::id::PipelineId; use cssparser::{Parser, ParserInput}; use dom_struct::dom_struct; use euclid::Point2D; @@ -19,7 +20,6 @@ use ipc_channel::router::ROUTER; use js::jsapi::JSAutoRealm; use js::rust::HandleObject; use mime::{self, Mime}; -use msg::constellation_msg::PipelineId; use net_traits::image::base::{Image, ImageMetadata}; use net_traits::image_cache::{ CorsStatus, ImageCache, ImageCacheResult, ImageOrMetadataAvailable, ImageResponse, diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 40315c3ecdf..eec9ae0684a 100755 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -11,7 +11,7 @@ use std::{f64, ptr}; use chrono::naive::{NaiveDate, NaiveDateTime}; use chrono::{DateTime, Datelike, Weekday}; use dom_struct::dom_struct; -use embedder_traits::FilterPattern; +use embedder_traits::{FilterPattern, InputMethodType}; use encoding_rs::Encoding; use html5ever::{local_name, namespace_url, ns, LocalName, Prefix}; use js::jsapi::{ @@ -21,7 +21,6 @@ use js::jsapi::{ use js::jsval::UndefinedValue; use js::rust::jsapi_wrapped::{ExecuteRegExpNoStatics, ObjectIsRegExp}; use js::rust::{HandleObject, MutableHandleObject}; -use msg::constellation_msg::InputMethodType; use net_traits::blob_url_store::get_blob_origin; use net_traits::filemanager_thread::FileManagerThreadMsg; use net_traits::{CoreResourceMsg, IpcSend}; diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index d0a59070cb6..e0563f91bf3 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -12,6 +12,7 @@ use std::ptr; use std::rc::Rc; use std::sync::{Arc, Mutex}; +use base::id::PipelineId; use content_security_policy as csp; use dom_struct::dom_struct; use encoding_rs::Encoding; @@ -24,7 +25,6 @@ use js::rust::{ transform_str_to_source_text, CompileOptionsWrapper, FinishOffThreadStencil, HandleObject, Stencil, }; -use msg::constellation_msg::PipelineId; use net_traits::request::{ CorsSettings, CredentialsMode, Destination, ParserMetadata, RequestBuilder, }; diff --git a/components/script/dom/messageport.rs b/components/script/dom/messageport.rs index 02ecae8e2b1..c7086c9403c 100644 --- a/components/script/dom/messageport.rs +++ b/components/script/dom/messageport.rs @@ -8,10 +8,10 @@ use std::convert::TryInto; use std::num::NonZeroU32; use std::rc::Rc; +use base::id::{MessagePortId, MessagePortIndex, PipelineNamespaceId}; use dom_struct::dom_struct; use js::jsapi::{Heap, JSObject, MutableHandleObject}; use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue}; -use msg::constellation_msg::{MessagePortId, MessagePortIndex, PipelineNamespaceId}; use script_traits::PortMessageTask; use crate::dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 19178806944..3531fb1b9f3 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -13,6 +13,7 @@ use std::sync::Arc as StdArc; use std::{cmp, iter}; use app_units::Au; +use base::id::{BrowsingContextId, PipelineId}; use bitflags::bitflags; use devtools_traits::NodeInfo; use dom_struct::dom_struct; @@ -22,7 +23,6 @@ use js::jsapi::JSObject; use js::rust::HandleObject; use libc::{self, c_void, uintptr_t}; use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; -use msg::constellation_msg::{BrowsingContextId, PipelineId}; use net_traits::image::base::{Image, ImageMetadata}; use script_layout_interface::{ GenericLayoutData, HTMLCanvasData, HTMLMediaData, LayoutElementType, LayoutNodeType, QueryMsg, diff --git a/components/script/dom/offlineaudiocontext.rs b/components/script/dom/offlineaudiocontext.rs index fcdffddb449..0d47380ab61 100644 --- a/components/script/dom/offlineaudiocontext.rs +++ b/components/script/dom/offlineaudiocontext.rs @@ -7,9 +7,9 @@ use std::rc::Rc; use std::sync::{mpsc, Arc, Mutex}; use std::thread::Builder; +use base::id::PipelineId; use dom_struct::dom_struct; use js::rust::HandleObject; -use msg::constellation_msg::PipelineId; use servo_media::audio::context::OfflineAudioContextOptions as ServoMediaOfflineAudioContextOptions; use crate::dom::audiobuffer::{AudioBuffer, MAX_SAMPLE_RATE, MIN_SAMPLE_RATE}; diff --git a/components/script/dom/paintworkletglobalscope.rs b/components/script/dom/paintworkletglobalscope.rs index daee955baab..4287b347a83 100644 --- a/components/script/dom/paintworkletglobalscope.rs +++ b/components/script/dom/paintworkletglobalscope.rs @@ -10,6 +10,7 @@ use std::sync::{Arc, Mutex}; use std::thread; use std::time::Duration; +use base::id::PipelineId; use crossbeam_channel::{unbounded, Sender}; use dom_struct::dom_struct; use euclid::{Scale, Size2D}; @@ -20,7 +21,6 @@ use js::jsapi::{ use js::jsval::{JSVal, ObjectValue, UndefinedValue}; use js::rust::wrappers::{Call, Construct1}; use js::rust::{HandleValue, Runtime}; -use msg::constellation_msg::PipelineId; use net_traits::image_cache::ImageCache; use pixels::PixelFormat; use profile_traits::ipc; diff --git a/components/script/dom/serviceworker.rs b/components/script/dom/serviceworker.rs index ee318f9a111..02f7b60f4c0 100644 --- a/components/script/dom/serviceworker.rs +++ b/components/script/dom/serviceworker.rs @@ -4,10 +4,10 @@ use std::cell::Cell; +use base::id::ServiceWorkerId; use dom_struct::dom_struct; use js::jsapi::{Heap, JSObject}; use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue}; -use msg::constellation_msg::ServiceWorkerId; use script_traits::{DOMMessage, ScriptMsg}; use servo_url::ServoUrl; diff --git a/components/script/dom/serviceworkerglobalscope.rs b/components/script/dom/serviceworkerglobalscope.rs index 8bede70297e..bd2c6dc79d0 100644 --- a/components/script/dom/serviceworkerglobalscope.rs +++ b/components/script/dom/serviceworkerglobalscope.rs @@ -7,6 +7,7 @@ use std::sync::Arc; use std::thread::{self, JoinHandle}; use std::time::{Duration, Instant}; +use base::id::PipelineId; use crossbeam_channel::{after, unbounded, Receiver, Sender}; use devtools_traits::DevtoolScriptControlMsg; use dom_struct::dom_struct; @@ -14,7 +15,6 @@ use ipc_channel::ipc::{IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use js::jsapi::{JSContext, JS_AddInterruptCallback}; use js::jsval::UndefinedValue; -use msg::constellation_msg::PipelineId; use net_traits::request::{CredentialsMode, Destination, ParserMetadata, Referrer, RequestBuilder}; use net_traits::{CustomResponseMediator, IpcSend}; use parking_lot::Mutex; diff --git a/components/script/dom/serviceworkerregistration.rs b/components/script/dom/serviceworkerregistration.rs index 481ff3aa965..c1eb63fa648 100644 --- a/components/script/dom/serviceworkerregistration.rs +++ b/components/script/dom/serviceworkerregistration.rs @@ -4,9 +4,9 @@ use std::cell::Cell; +use base::id::ServiceWorkerRegistrationId; use devtools_traits::WorkerId; use dom_struct::dom_struct; -use msg::constellation_msg::ServiceWorkerRegistrationId; use script_traits::{ScopeThings, WorkerScriptLoadOrigin}; use servo_url::ServoUrl; use uuid::Uuid; diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 507e2a2cb99..138aa8d4546 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -6,6 +6,7 @@ use std::borrow::Cow; use std::cell::Cell; use std::mem; +use base::id::PipelineId; use base64::engine::general_purpose; use base64::Engine as _; use content_security_policy::{self as csp, CspList}; @@ -20,7 +21,6 @@ use html5ever::tree_builder::{ElementFlags, NextParserState, NodeOrText, QuirksM use html5ever::{local_name, namespace_url, ns, Attribute, ExpandedName, LocalName, QualName}; use hyper_serde::Serde; use mime::{self, Mime}; -use msg::constellation_msg::PipelineId; use net_traits::{ FetchMetadata, FetchResponseListener, Metadata, NetworkError, ResourceFetchTiming, ResourceTimingType, diff --git a/components/script/dom/servoparser/prefetch.rs b/components/script/dom/servoparser/prefetch.rs index d11da362149..1f57ccc0a94 100644 --- a/components/script/dom/servoparser/prefetch.rs +++ b/components/script/dom/servoparser/prefetch.rs @@ -2,6 +2,7 @@ * 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/. */ +use base::id::PipelineId; use html5ever::buffer_queue::BufferQueue; use html5ever::tokenizer::states::RawKind; use html5ever::tokenizer::{ @@ -9,7 +10,6 @@ use html5ever::tokenizer::{ }; use html5ever::{local_name, Attribute, LocalName}; use js::jsapi::JSTracer; -use msg::constellation_msg::PipelineId; use net_traits::request::{CorsSettings, CredentialsMode, ParserMetadata, Referrer}; use net_traits::{CoreResourceMsg, FetchChannels, IpcSend, ReferrerPolicy, ResourceThreads}; use servo_url::{ImmutableOrigin, ServoUrl}; diff --git a/components/script/dom/testworkletglobalscope.rs b/components/script/dom/testworkletglobalscope.rs index 71c20ad9966..2540bc31415 100644 --- a/components/script/dom/testworkletglobalscope.rs +++ b/components/script/dom/testworkletglobalscope.rs @@ -4,10 +4,10 @@ use std::collections::HashMap; +use base::id::PipelineId; use crossbeam_channel::Sender; use dom_struct::dom_struct; use js::rust::Runtime; -use msg::constellation_msg::PipelineId; use servo_url::ServoUrl; use crate::dom::bindings::cell::DomRefCell; diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index ae50518c2c8..b034c9c5d29 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -16,6 +16,7 @@ use std::{cmp, env, mem}; use app_units::Au; use backtrace::Backtrace; +use base::id::{BrowsingContextId, PipelineId}; use base64::Engine; use bluetooth_traits::BluetoothRequest; use canvas_traits::webgl::WebGLChan; @@ -26,7 +27,6 @@ use dom_struct::dom_struct; use embedder_traits::{EmbedderMsg, PromptDefinition, PromptOrigin, PromptResult}; use euclid::default::{Point2D as UntypedPoint2D, Rect as UntypedRect}; use euclid::{Point2D, Rect, Scale, Size2D, Vector2D}; -use gfx_traits::combine_id_with_fragment_type; use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; use js::conversions::ToJSValConvertible; @@ -38,7 +38,6 @@ use js::rust::{ }; use malloc_size_of::MallocSizeOf; use media::WindowGLContext; -use msg::constellation_msg::{BrowsingContextId, PipelineId}; use net_traits::image_cache::{ ImageCache, ImageResponder, ImageResponse, PendingImageId, PendingImageResponse, }; @@ -50,7 +49,8 @@ use profile_traits::ipc as ProfiledIpc; use profile_traits::mem::ProfilerChan as MemProfilerChan; use profile_traits::time::ProfilerChan as TimeProfilerChan; use script_layout_interface::{ - Layout, PendingImageState, QueryMsg, Reflow, ReflowGoal, ScriptReflow, TrustedNodeAddress, + combine_id_with_fragment_type, FragmentType, Layout, PendingImageState, QueryMsg, Reflow, + ReflowGoal, ScriptReflow, TrustedNodeAddress, }; use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; use script_traits::{ @@ -2110,10 +2110,7 @@ impl Window { .borrow_mut() .insert(node.to_opaque(), Vector2D::new(x_ as f32, y_ as f32)); let scroll_id = ExternalScrollId( - combine_id_with_fragment_type( - node.to_opaque().id(), - gfx_traits::FragmentType::FragmentBody, - ), + combine_id_with_fragment_type(node.to_opaque().id(), FragmentType::FragmentBody), self.pipeline_id().into(), ); diff --git a/components/script/dom/windowproxy.rs b/components/script/dom/windowproxy.rs index 24a7afe7672..92ecd52968d 100644 --- a/components/script/dom/windowproxy.rs +++ b/components/script/dom/windowproxy.rs @@ -5,6 +5,7 @@ use std::cell::Cell; use std::ptr; +use base::id::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId}; use dom_struct::dom_struct; use embedder_traits::EmbedderMsg; use html5ever::local_name; @@ -27,7 +28,6 @@ use js::jsval::{JSVal, NullValue, PrivateValue, UndefinedValue}; use js::rust::wrappers::{JS_TransplantObject, NewWindowProxy, SetWindowProxy}; use js::rust::{get_object_class, Handle, MutableHandle}; use js::JSCLASS_IS_GLOBAL; -use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId}; use net_traits::request::Referrer; use script_traits::{ AuxiliaryBrowsingContextLoadInfo, HistoryEntryReplacement, LoadData, LoadOrigin, NewLayoutInfo, diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index 7c10b459c93..61c5a4a59a7 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -7,6 +7,7 @@ use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; +use base::id::{PipelineId, PipelineNamespace}; use crossbeam_channel::Receiver; use devtools_traits::{DevtoolScriptControlMsg, WorkerId}; use dom_struct::dom_struct; @@ -14,7 +15,6 @@ use ipc_channel::ipc::IpcSender; use js::jsval::UndefinedValue; use js::panic::maybe_resume_unwind; use js::rust::{HandleValue, ParentRuntime}; -use msg::constellation_msg::{PipelineId, PipelineNamespace}; use net_traits::request::{ CredentialsMode, Destination, ParserMetadata, RequestBuilder as NetRequestInit, }; diff --git a/components/script/dom/worklet.rs b/components/script/dom/worklet.rs index 318e4fc533b..697bba659e7 100644 --- a/components/script/dom/worklet.rs +++ b/components/script/dom/worklet.rs @@ -18,11 +18,11 @@ use std::sync::atomic::{AtomicIsize, Ordering}; use std::sync::Arc; use std::thread; +use base::id::PipelineId; use crossbeam_channel::{unbounded, Receiver, Sender}; use dom_struct::dom_struct; use js::jsapi::{GCReason, JSGCParamKey, JSTracer, JS_GetGCParameter, JS_GC}; use malloc_size_of::malloc_size_of_is_0; -use msg::constellation_msg::PipelineId; use net_traits::request::{Destination, RequestBuilder, RequestMode}; use net_traits::IpcSend; use servo_url::{ImmutableOrigin, ServoUrl}; diff --git a/components/script/dom/workletglobalscope.rs b/components/script/dom/workletglobalscope.rs index f364926f71c..6357a896942 100644 --- a/components/script/dom/workletglobalscope.rs +++ b/components/script/dom/workletglobalscope.rs @@ -5,13 +5,13 @@ use std::borrow::Cow; use std::sync::Arc; +use base::id::PipelineId; use crossbeam_channel::Sender; use devtools_traits::ScriptToDevtoolsControlMsg; use dom_struct::dom_struct; use ipc_channel::ipc::IpcSender; use js::jsval::UndefinedValue; use js::rust::Runtime; -use msg::constellation_msg::PipelineId; use net_traits::image_cache::ImageCache; use net_traits::ResourceThreads; use parking_lot::Mutex; diff --git a/components/script/dom/xrsystem.rs b/components/script/dom/xrsystem.rs index e7118d3544a..fdeb931b1d7 100644 --- a/components/script/dom/xrsystem.rs +++ b/components/script/dom/xrsystem.rs @@ -5,10 +5,10 @@ use std::cell::Cell; use std::rc::Rc; +use base::id::PipelineId; use dom_struct::dom_struct; use ipc_channel::ipc::{self as ipc_crate, IpcReceiver}; use ipc_channel::router::ROUTER; -use msg::constellation_msg::PipelineId; use profile_traits::ipc; use servo_config::pref; use webxr_api::{Error as XRError, Frame, Session, SessionInit, SessionMode}; diff --git a/components/script/layout_dom/node.rs b/components/script/layout_dom/node.rs index 0cbdba64573..7a521d36220 100644 --- a/components/script/layout_dom/node.rs +++ b/components/script/layout_dom/node.rs @@ -8,9 +8,9 @@ use std::borrow::Cow; use std::fmt; use std::sync::Arc as StdArc; +use base::id::{BrowsingContextId, PipelineId}; use gfx_traits::ByteIndex; use html5ever::{local_name, namespace_url, ns}; -use msg::constellation_msg::{BrowsingContextId, PipelineId}; use net_traits::image::base::{Image, ImageMetadata}; use range::Range; use script_layout_interface::wrapper_traits::{ diff --git a/components/script/microtask.rs b/components/script/microtask.rs index 904925fc9db..820afcc5f97 100644 --- a/components/script/microtask.rs +++ b/components/script/microtask.rs @@ -10,8 +10,8 @@ use std::cell::Cell; use std::mem; use std::rc::Rc; +use base::id::PipelineId; use js::jsapi::{JSAutoRealm, JobQueueIsEmpty, JobQueueMayNotBeEmpty}; -use msg::constellation_msg::PipelineId; use crate::dom::bindings::callback::ExceptionHandling; use crate::dom::bindings::cell::DomRefCell; diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index 9aac9fb9baa..f635bd0b1a7 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -18,6 +18,7 @@ use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; use std::{fmt, os, ptr, thread}; +use base::id::PipelineId; use js::glue::{ CollectServoSizes, CreateJobQueue, DeleteJobQueue, DispatchableRun, JobQueueTraps, RUST_js_GetErrorMessage, SetBuildId, StreamConsumerConsumeChunk, @@ -45,7 +46,6 @@ use js::rust::{ }; use lazy_static::lazy_static; use malloc_size_of::MallocSizeOfOps; -use msg::constellation_msg::PipelineId; use profile_traits::mem::{Report, ReportKind, ReportsChan}; use profile_traits::path; use servo_config::{opts, pref}; diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 1259d7f703e..7231dfc54dd 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -29,6 +29,13 @@ use std::sync::Arc; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; use std::{ptr, thread}; +use background_hang_monitor_api::{ + BackgroundHangMonitor, BackgroundHangMonitorExitSignal, HangAnnotation, MonitoredComponentId, + MonitoredComponentType, ScriptHangAnnotation, +}; +use base::id::{ + BrowsingContextId, HistoryStateId, PipelineId, PipelineNamespace, TopLevelBrowsingContextId, +}; use bluetooth_traits::BluetoothRequest; use canvas_traits::webgl::WebGLPipeline; use chrono::{DateTime, Local}; @@ -55,11 +62,6 @@ use js::rust::ParentRuntime; use media::WindowGLContext; use metrics::{PaintTimeMetrics, MAX_TASK_NS}; use mime::{self, Mime}; -use msg::constellation_msg::{ - BackgroundHangMonitor, BackgroundHangMonitorExitSignal, BrowsingContextId, HangAnnotation, - HistoryStateId, MonitoredComponentId, MonitoredComponentType, PipelineId, PipelineNamespace, - ScriptHangAnnotation, TopLevelBrowsingContextId, -}; use net_traits::image_cache::{ImageCache, PendingImageResponse}; use net_traits::request::{CredentialsMode, Destination, RedirectMode, RequestBuilder}; use net_traits::storage_thread::StorageType; diff --git a/components/script/serviceworker_manager.rs b/components/script/serviceworker_manager.rs index c16c5597b90..8059e4ee41b 100644 --- a/components/script/serviceworker_manager.rs +++ b/components/script/serviceworker_manager.rs @@ -12,10 +12,10 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::thread::{self, JoinHandle}; +use base::id::{PipelineNamespace, ServiceWorkerId, ServiceWorkerRegistrationId}; use crossbeam_channel::{select, unbounded, Receiver, RecvError, Sender}; use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; -use msg::constellation_msg::{PipelineNamespace, ServiceWorkerId, ServiceWorkerRegistrationId}; use net_traits::{CoreResourceMsg, CustomResponseMediator}; use script_traits::{ DOMMessage, Job, JobError, JobResult, JobResultValue, JobType, SWManagerMsg, SWManagerSenders, diff --git a/components/script/stylesheet_loader.rs b/components/script/stylesheet_loader.rs index d9c2d789119..90aeb8754f1 100644 --- a/components/script/stylesheet_loader.rs +++ b/components/script/stylesheet_loader.rs @@ -5,12 +5,12 @@ use std::sync::atomic::AtomicBool; use std::sync::Mutex; +use base::id::PipelineId; use cssparser::SourceLocation; use encoding_rs::UTF_8; use ipc_channel::ipc; use ipc_channel::router::ROUTER; use mime::{self, Mime}; -use msg::constellation_msg::PipelineId; use net_traits::request::{CorsSettings, Destination, Referrer, RequestBuilder}; use net_traits::{ FetchMetadata, FetchResponseListener, FilteredMetadata, Metadata, NetworkError, ReferrerPolicy, diff --git a/components/script/task_queue.rs b/components/script/task_queue.rs index 0a84feae7b8..96fc49c81af 100644 --- a/components/script/task_queue.rs +++ b/components/script/task_queue.rs @@ -8,8 +8,8 @@ use std::cell::Cell; use std::collections::{HashMap, HashSet, VecDeque}; use std::default::Default; +use base::id::PipelineId; use crossbeam_channel::{self, Receiver, Sender}; -use msg::constellation_msg::PipelineId; use crate::dom::bindings::cell::DomRefCell; use crate::dom::worker::TrustedWorkerAddress; diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs index eaff254a5cf..1469db66155 100644 --- a/components/script/task_source/dom_manipulation.rs +++ b/components/script/task_source/dom_manipulation.rs @@ -5,7 +5,7 @@ use std::fmt; use std::result::Result; -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use servo_atoms::Atom; use crate::dom::bindings::inheritance::Castable; diff --git a/components/script/task_source/file_reading.rs b/components/script/task_source/file_reading.rs index 77e566dbf63..afb1f5c104a 100644 --- a/components/script/task_source/file_reading.rs +++ b/components/script/task_source/file_reading.rs @@ -2,7 +2,7 @@ * 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/. */ -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use crate::dom::domexception::DOMErrorName; use crate::dom::filereader::{FileReader, GenerationId, ReadMetaData, TrustedFileReader}; diff --git a/components/script/task_source/gamepad.rs b/components/script/task_source/gamepad.rs index e6694f3daea..9d38257bace 100644 --- a/components/script/task_source/gamepad.rs +++ b/components/script/task_source/gamepad.rs @@ -5,7 +5,7 @@ use std::fmt; use std::result::Result; -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory}; use crate::task::{TaskCanceller, TaskOnce}; diff --git a/components/script/task_source/history_traversal.rs b/components/script/task_source/history_traversal.rs index 1676461fa99..4bb90a1ffcb 100644 --- a/components/script/task_source/history_traversal.rs +++ b/components/script/task_source/history_traversal.rs @@ -2,8 +2,8 @@ * 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/. */ +use base::id::PipelineId; use crossbeam_channel::Sender; -use msg::constellation_msg::PipelineId; use crate::script_runtime::{CommonScriptMsg, ScriptThreadEventCategory}; use crate::script_thread::MainThreadScriptMsg; diff --git a/components/script/task_source/media_element.rs b/components/script/task_source/media_element.rs index 64d2f6c2764..944ffc4f5bf 100644 --- a/components/script/task_source/media_element.rs +++ b/components/script/task_source/media_element.rs @@ -5,8 +5,8 @@ use std::fmt; use std::result::Result; +use base::id::PipelineId; use crossbeam_channel::Sender; -use msg::constellation_msg::PipelineId; use servo_atoms::Atom; use crate::dom::bindings::inheritance::Castable; diff --git a/components/script/task_source/networking.rs b/components/script/task_source/networking.rs index b55331af526..f142c1f6ae0 100644 --- a/components/script/task_source/networking.rs +++ b/components/script/task_source/networking.rs @@ -2,7 +2,7 @@ * 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/. */ -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory}; use crate::task::{TaskCanceller, TaskOnce}; diff --git a/components/script/task_source/performance_timeline.rs b/components/script/task_source/performance_timeline.rs index 9f6f56a2cf4..9bcfe4bc1d8 100644 --- a/components/script/task_source/performance_timeline.rs +++ b/components/script/task_source/performance_timeline.rs @@ -9,7 +9,7 @@ use std::fmt; use std::result::Result; -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use crate::dom::bindings::refcounted::Trusted; use crate::dom::globalscope::GlobalScope; diff --git a/components/script/task_source/port_message.rs b/components/script/task_source/port_message.rs index b9bca1e6194..0ca613c647c 100644 --- a/components/script/task_source/port_message.rs +++ b/components/script/task_source/port_message.rs @@ -4,7 +4,7 @@ use std::fmt; -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory}; use crate::task::{TaskCanceller, TaskOnce}; diff --git a/components/script/task_source/remote_event.rs b/components/script/task_source/remote_event.rs index cadba9b3016..9a70d2a0234 100644 --- a/components/script/task_source/remote_event.rs +++ b/components/script/task_source/remote_event.rs @@ -2,7 +2,7 @@ * 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/. */ -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory}; use crate::task::{TaskCanceller, TaskOnce}; diff --git a/components/script/task_source/rendering.rs b/components/script/task_source/rendering.rs index 732eb2aef2b..43afa4abb68 100644 --- a/components/script/task_source/rendering.rs +++ b/components/script/task_source/rendering.rs @@ -5,7 +5,7 @@ use std::fmt; use std::result::Result; -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory}; use crate::task::{TaskCanceller, TaskOnce}; diff --git a/components/script/task_source/timer.rs b/components/script/task_source/timer.rs index e565a3aaa22..4f8ad10d811 100644 --- a/components/script/task_source/timer.rs +++ b/components/script/task_source/timer.rs @@ -4,7 +4,7 @@ use std::fmt; -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory}; use crate::task::{TaskCanceller, TaskOnce}; diff --git a/components/script/task_source/user_interaction.rs b/components/script/task_source/user_interaction.rs index a16277f2781..9ddc06d9185 100644 --- a/components/script/task_source/user_interaction.rs +++ b/components/script/task_source/user_interaction.rs @@ -5,8 +5,8 @@ use std::fmt; use std::result::Result; +use base::id::PipelineId; use crossbeam_channel::Sender; -use msg::constellation_msg::PipelineId; use servo_atoms::Atom; use crate::dom::bindings::inheritance::Castable; diff --git a/components/script/task_source/websocket.rs b/components/script/task_source/websocket.rs index 27ad5202373..2d05067e28b 100644 --- a/components/script/task_source/websocket.rs +++ b/components/script/task_source/websocket.rs @@ -2,7 +2,7 @@ * 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/. */ -use msg::constellation_msg::PipelineId; +use base::id::PipelineId; use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory}; use crate::task::{TaskCanceller, TaskOnce}; diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index ebc15484e92..11c43f40878 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -6,6 +6,7 @@ use std::cmp; use std::collections::HashMap; use std::ffi::CString; +use base::id::{BrowsingContextId, PipelineId}; use cookie::Cookie; use euclid::default::{Point2D, Rect, Size2D}; use hyper_serde::Serde; @@ -14,7 +15,6 @@ use js::jsapi::{HandleValueArray, JSAutoRealm, JSContext, JSType, JS_IsException use js::jsval::UndefinedValue; use js::rust::wrappers::{JS_CallFunctionName, JS_GetProperty, JS_HasOwnProperty, JS_TypeOfValue}; use js::rust::{HandleObject, HandleValue}; -use msg::constellation_msg::{BrowsingContextId, PipelineId}; use net_traits::CookieSource::{NonHTTP, HTTP}; use net_traits::CoreResourceMsg::{DeleteCookies, GetCookiesDataForUrl, SetCookieForUrl}; use net_traits::IpcSend; |