Auto merge of #22028 - asajeffrey:debug-all-the-things, r=emilio

Add lots of derived Debug impls

<!-- Please describe your changes on the following line: -->

Add a bunch of derived `Debug` impls. After this, pretty much anything that implements `Deserializable` also implements `Debug`. The exception is `webrender_api::RenderApiSender`, which would need a webrender PR.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because it's just debugging

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22028)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-10-29 14:17:02 -04:00 committed by GitHub
commit a59a80b301
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 125 additions and 124 deletions

View file

@ -14,7 +14,7 @@ pub mod scanfilter;
use ipc_channel::ipc::IpcSender; use ipc_channel::ipc::IpcSender;
use scanfilter::{BluetoothScanfilterSequence, RequestDeviceoptions}; use scanfilter::{BluetoothScanfilterSequence, RequestDeviceoptions};
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum BluetoothError { pub enum BluetoothError {
Type(String), Type(String),
Network, Network,
@ -24,7 +24,7 @@ pub enum BluetoothError {
InvalidState, InvalidState,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum GATTType { pub enum GATTType {
PrimaryService, PrimaryService,
Characteristic, Characteristic,
@ -32,21 +32,21 @@ pub enum GATTType {
Descriptor, Descriptor,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothDeviceMsg { pub struct BluetoothDeviceMsg {
// Bluetooth Device properties // Bluetooth Device properties
pub id: String, pub id: String,
pub name: Option<String>, pub name: Option<String>,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothServiceMsg { pub struct BluetoothServiceMsg {
pub uuid: String, pub uuid: String,
pub is_primary: bool, pub is_primary: bool,
pub instance_id: String, pub instance_id: String,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothCharacteristicMsg { pub struct BluetoothCharacteristicMsg {
// Characteristic // Characteristic
pub uuid: String, pub uuid: String,
@ -63,7 +63,7 @@ pub struct BluetoothCharacteristicMsg {
pub writable_auxiliaries: bool, pub writable_auxiliaries: bool,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothDescriptorMsg { pub struct BluetoothDescriptorMsg {
pub uuid: String, pub uuid: String,
pub instance_id: String, pub instance_id: String,
@ -79,7 +79,7 @@ pub type BluetoothResult<T> = Result<T, BluetoothError>;
pub type BluetoothResponseResult = Result<BluetoothResponse, BluetoothError>; pub type BluetoothResponseResult = Result<BluetoothResponse, BluetoothError>;
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum BluetoothRequest { pub enum BluetoothRequest {
RequestDevice(RequestDeviceoptions, IpcSender<BluetoothResponseResult>), RequestDevice(RequestDeviceoptions, IpcSender<BluetoothResponseResult>),
GATTServerConnect(String, IpcSender<BluetoothResponseResult>), GATTServerConnect(String, IpcSender<BluetoothResponseResult>),
@ -107,7 +107,7 @@ pub enum BluetoothRequest {
Exit, Exit,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum BluetoothResponse { pub enum BluetoothResponse {
RequestDevice(BluetoothDeviceMsg), RequestDevice(BluetoothDeviceMsg),
GATTServerConnect(bool), GATTServerConnect(bool),

View file

@ -10,7 +10,7 @@ use std::slice::Iter;
// That leaves 29 bytes for the name. // That leaves 29 bytes for the name.
const MAX_NAME_LENGTH: usize = 29; const MAX_NAME_LENGTH: usize = 29;
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct ServiceUUIDSequence(Vec<String>); pub struct ServiceUUIDSequence(Vec<String>);
impl ServiceUUIDSequence { impl ServiceUUIDSequence {
@ -26,7 +26,7 @@ impl ServiceUUIDSequence {
type ManufacturerData = HashMap<u16, (Vec<u8>, Vec<u8>)>; type ManufacturerData = HashMap<u16, (Vec<u8>, Vec<u8>)>;
type ServiceData = HashMap<String, (Vec<u8>, Vec<u8>)>; type ServiceData = HashMap<String, (Vec<u8>, Vec<u8>)>;
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothScanfilter { pub struct BluetoothScanfilter {
name: Option<String>, name: Option<String>,
name_prefix: String, name_prefix: String,
@ -83,7 +83,7 @@ impl BluetoothScanfilter {
} }
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothScanfilterSequence(Vec<BluetoothScanfilter>); pub struct BluetoothScanfilterSequence(Vec<BluetoothScanfilter>);
impl BluetoothScanfilterSequence { impl BluetoothScanfilterSequence {
@ -110,7 +110,7 @@ impl BluetoothScanfilterSequence {
} }
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct RequestDeviceoptions { pub struct RequestDeviceoptions {
filters: BluetoothScanfilterSequence, filters: BluetoothScanfilterSequence,
optional_services: ServiceUUIDSequence, optional_services: ServiceUUIDSequence,

View file

@ -10,13 +10,13 @@ use std::default::Default;
use std::str::FromStr; use std::str::FromStr;
use webrender_api; use webrender_api;
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum FillRule { pub enum FillRule {
Nonzero, Nonzero,
Evenodd, Evenodd,
} }
#[derive(Clone, Copy, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)]
pub struct CanvasId(pub u64); pub struct CanvasId(pub u64);
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
@ -30,12 +30,12 @@ pub enum CanvasMsg {
Exit, Exit,
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CanvasImageData { pub struct CanvasImageData {
pub image_key: webrender_api::ImageKey, pub image_key: webrender_api::ImageKey,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum Canvas2dMsg { pub enum Canvas2dMsg {
Arc(Point2D<f32>, f32, f32, f32, bool), Arc(Point2D<f32>, f32, f32, f32, bool),
ArcTo(Point2D<f32>, Point2D<f32>, f32), ArcTo(Point2D<f32>, Point2D<f32>, f32),
@ -77,23 +77,23 @@ pub enum Canvas2dMsg {
SetShadowColor(RGBA), SetShadowColor(RGBA),
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum FromLayoutMsg { pub enum FromLayoutMsg {
SendData(IpcSender<CanvasImageData>), SendData(IpcSender<CanvasImageData>),
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum FromScriptMsg { pub enum FromScriptMsg {
SendPixels(IpcSender<Option<ByteBuf>>), SendPixels(IpcSender<Option<ByteBuf>>),
} }
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct CanvasGradientStop { pub struct CanvasGradientStop {
pub offset: f64, pub offset: f64,
pub color: RGBA, pub color: RGBA,
} }
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct LinearGradientStyle { pub struct LinearGradientStyle {
pub x0: f64, pub x0: f64,
pub y0: f64, pub y0: f64,
@ -115,7 +115,7 @@ impl LinearGradientStyle {
} }
} }
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct RadialGradientStyle { pub struct RadialGradientStyle {
pub x0: f64, pub x0: f64,
pub y0: f64, pub y0: f64,
@ -141,7 +141,7 @@ impl RadialGradientStyle {
} }
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct SurfaceStyle { pub struct SurfaceStyle {
pub surface_data: ByteBuf, pub surface_data: ByteBuf,
pub surface_size: Size2D<u32>, pub surface_size: Size2D<u32>,
@ -166,7 +166,7 @@ impl SurfaceStyle {
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum FillOrStrokeStyle { pub enum FillOrStrokeStyle {
Color(RGBA), Color(RGBA),
LinearGradient(LinearGradientStyle), LinearGradient(LinearGradientStyle),
@ -174,7 +174,7 @@ pub enum FillOrStrokeStyle {
Surface(SurfaceStyle), Surface(SurfaceStyle),
} }
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum LineCapStyle { pub enum LineCapStyle {
Butt = 0, Butt = 0,
Round = 1, Round = 1,
@ -194,7 +194,7 @@ impl FromStr for LineCapStyle {
} }
} }
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum LineJoinStyle { pub enum LineJoinStyle {
Round = 0, Round = 0,
Bevel = 1, Bevel = 1,
@ -214,7 +214,7 @@ impl FromStr for LineJoinStyle {
} }
} }
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum RepetitionStyle { pub enum RepetitionStyle {
Repeat, Repeat,
RepeatX, RepeatX,
@ -236,7 +236,7 @@ impl FromStr for RepetitionStyle {
} }
} }
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum CompositionStyle { pub enum CompositionStyle {
SrcIn, SrcIn,
SrcOut, SrcOut,
@ -290,7 +290,7 @@ impl CompositionStyle {
} }
} }
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum BlendingStyle { pub enum BlendingStyle {
Multiply, Multiply,
Screen, Screen,
@ -356,7 +356,7 @@ impl BlendingStyle {
} }
} }
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum CompositionOrBlending { pub enum CompositionOrBlending {
Composition(CompositionStyle), Composition(CompositionStyle),
Blending(BlendingStyle), Blending(BlendingStyle),

View file

@ -24,7 +24,7 @@ pub use ::webgl_channel::WebGLPipeline;
/// Entry point channel type used for sending WebGLMsg messages to the WebGL renderer. /// Entry point channel type used for sending WebGLMsg messages to the WebGL renderer.
pub use ::webgl_channel::WebGLChan; pub use ::webgl_channel::WebGLChan;
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct WebGLCommandBacktrace { pub struct WebGLCommandBacktrace {
#[cfg(feature = "webgl_backtrace")] #[cfg(feature = "webgl_backtrace")]
pub backtrace: String, pub backtrace: String,
@ -33,7 +33,7 @@ pub struct WebGLCommandBacktrace {
} }
/// WebGL Message API /// WebGL Message API
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebGLMsg { pub enum WebGLMsg {
/// Creates a new WebGLContext. /// Creates a new WebGLContext.
CreateContext( CreateContext(
@ -70,7 +70,7 @@ pub enum WebGLMsg {
} }
/// Contains the WebGLCommand sender and information about a WebGLContext /// Contains the WebGLCommand sender and information about a WebGLContext
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct WebGLCreateContextResult { pub struct WebGLCreateContextResult {
/// Sender instance to send commands to the specific WebGLContext /// Sender instance to send commands to the specific WebGLContext
pub sender: WebGLMsgSender, pub sender: WebGLMsgSender,
@ -82,7 +82,7 @@ pub struct WebGLCreateContextResult {
pub glsl_version: WebGLSLVersion, pub glsl_version: WebGLSLVersion,
} }
#[derive(Clone, Copy, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, Serialize)]
pub enum WebGLContextShareMode { pub enum WebGLContextShareMode {
/// Fast: a shared texture_id is used in WebRender. /// Fast: a shared texture_id is used in WebRender.
SharedTexture, SharedTexture,
@ -91,7 +91,7 @@ pub enum WebGLContextShareMode {
} }
/// Defines the WebGL version /// Defines the WebGL version
#[derive(Clone, Copy, Deserialize, Eq, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, MallocSizeOf, PartialEq, Serialize)]
pub enum WebGLVersion { pub enum WebGLVersion {
/// https://www.khronos.org/registry/webgl/specs/1.0.2/ /// https://www.khronos.org/registry/webgl/specs/1.0.2/
/// Conforms closely to the OpenGL ES 2.0 API /// Conforms closely to the OpenGL ES 2.0 API
@ -102,7 +102,7 @@ pub enum WebGLVersion {
} }
/// Defines the GLSL version supported by the WebGL backend contexts. /// Defines the GLSL version supported by the WebGL backend contexts.
#[derive(Clone, Copy, Deserialize, Eq, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, MallocSizeOf, PartialEq, Serialize)]
pub struct WebGLSLVersion { pub struct WebGLSLVersion {
/// Major GLSL version /// Major GLSL version
pub major: u32, pub major: u32,
@ -111,7 +111,7 @@ pub struct WebGLSLVersion {
} }
/// Helper struct to send WebGLCommands to a specific WebGLContext. /// Helper struct to send WebGLCommands to a specific WebGLContext.
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct WebGLMsgSender { pub struct WebGLMsgSender {
ctx_id: WebGLContextId, ctx_id: WebGLContextId,
#[ignore_malloc_size_of = "channels are hard"] #[ignore_malloc_size_of = "channels are hard"]
@ -414,7 +414,7 @@ pub type WebGLResult<T> = Result<T, WebGLError>;
pub type WebVRDeviceId = u32; pub type WebVRDeviceId = u32;
// WebVR commands that must be called in the WebGL render thread. // WebVR commands that must be called in the WebGL render thread.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum WebVRCommand { pub enum WebVRCommand {
/// Start presenting to a VR device. /// Start presenting to a VR device.
Create(WebVRDeviceId), Create(WebVRDeviceId),
@ -433,7 +433,7 @@ pub trait WebVRRenderHandler: Send {
} }
/// WebGL commands required to implement DOMToTexture feature. /// WebGL commands required to implement DOMToTexture feature.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum DOMToTextureCommand { pub enum DOMToTextureCommand {
/// Attaches a HTMLIFrameElement to a WebGLTexture. /// Attaches a HTMLIFrameElement to a WebGLTexture.
Attach(WebGLContextId, WebGLTextureId, DocumentId, PipelineId, Size2D<i32>), Attach(WebGLContextId, WebGLTextureId, DocumentId, PipelineId, Size2D<i32>),
@ -444,7 +444,7 @@ pub enum DOMToTextureCommand {
} }
/// Information about a WebGL program linking operation. /// Information about a WebGL program linking operation.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ProgramLinkInfo { pub struct ProgramLinkInfo {
/// Whether the program was linked successfully. /// Whether the program was linked successfully.
pub linked: bool, pub linked: bool,
@ -455,7 +455,7 @@ pub struct ProgramLinkInfo {
} }
/// Description of a single active attribute. /// Description of a single active attribute.
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct ActiveAttribInfo { pub struct ActiveAttribInfo {
/// The name of the attribute. /// The name of the attribute.
pub name: String, pub name: String,
@ -468,7 +468,7 @@ pub struct ActiveAttribInfo {
} }
/// Description of a single active uniform. /// Description of a single active uniform.
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct ActiveUniformInfo { pub struct ActiveUniformInfo {
/// The base name of the uniform. /// The base name of the uniform.
pub base_name: Box<str>, pub base_name: Box<str>,

View file

@ -85,7 +85,7 @@ where
} }
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct WebGLChan(pub WebGLSender<WebGLMsg>); pub struct WebGLChan(pub WebGLSender<WebGLMsg>);
impl WebGLChan { impl WebGLChan {
@ -95,7 +95,7 @@ impl WebGLChan {
} }
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct WebGLPipeline(pub WebGLChan); pub struct WebGLPipeline(pub WebGLChan);
impl WebGLPipeline { impl WebGLPipeline {

View file

@ -23,7 +23,7 @@ use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
use url::{self, Url}; use url::{self, Url};
/// Global flags for Servo, currently set on the command line. /// Global flags for Servo, currently set on the command line.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Opts { pub struct Opts {
pub is_running_problem_test: bool, pub is_running_problem_test: bool,
@ -474,7 +474,7 @@ fn print_debug_usage(app: &str) -> ! {
process::exit(0) process::exit(0)
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum OutputOptions { pub enum OutputOptions {
/// Database connection config (hostname, name, user, pass) /// Database connection config (hostname, name, user, pass)
DB(ServoUrl, Option<String>, Option<String>, Option<String>), DB(ServoUrl, Option<String>, Option<String>, Option<String>),

View file

@ -864,6 +864,7 @@ where
/// Handles loading pages, navigation, and granting access to the compositor /// Handles loading pages, navigation, and granting access to the compositor
fn handle_request(&mut self) { fn handle_request(&mut self) {
#[derive(Debug)]
enum Request { enum Request {
Script((PipelineId, FromScriptMsg)), Script((PipelineId, FromScriptMsg)),
Compositor(FromCompositorMsg), Compositor(FromCompositorMsg),

View file

@ -23,7 +23,7 @@ thread_local! {
} }
/// A single "paragraph" of text in one font size and style. /// A single "paragraph" of text in one font size and style.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TextRun { pub struct TextRun {
/// The UTF-8 string represented by this text run. /// The UTF-8 string represented by this text run.
pub text: Arc<String>, pub text: Arc<String>,
@ -51,7 +51,7 @@ impl Drop for TextRun {
} }
/// A single series of glyphs within a text run. /// A single series of glyphs within a text run.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct GlyphRun { pub struct GlyphRun {
/// The glyphs. /// The glyphs.
pub glyph_store: Arc<GlyphStore>, pub glyph_store: Arc<GlyphStore>,

View file

@ -270,7 +270,7 @@ pub const TEST_BROWSING_CONTEXT_ID: BrowsingContextId = BrowsingContextId {
// Used to specify the kind of input method editor appropriate to edit a field. // Used to specify the kind of input method editor appropriate to edit a field.
// This is a subset of htmlinputelement::InputType because some variants of InputType // This is a subset of htmlinputelement::InputType because some variants of InputType
// don't make sense in this context. // don't make sense in this context.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum InputMethodType { pub enum InputMethodType {
Color, Color,
Date, Date,

View file

@ -11,7 +11,7 @@ use std::collections::HashMap;
use std::net::{Ipv4Addr, Ipv6Addr}; use std::net::{Ipv4Addr, Ipv6Addr};
use time; use time;
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct HstsEntry { pub struct HstsEntry {
pub host: String, pub host: String,
pub include_subdomains: bool, pub include_subdomains: bool,
@ -52,7 +52,7 @@ impl HstsEntry {
} }
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct HstsList { pub struct HstsList {
pub entries_map: HashMap<String, Vec<HstsEntry>>, pub entries_map: HashMap<String, Vec<HstsEntry>>,
} }

View file

@ -345,7 +345,7 @@ pub fn write_json_to_file<T>(data: &T, config_dir: &Path, filename: &str)
} }
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AuthCacheEntry { pub struct AuthCacheEntry {
pub user_name: String, pub user_name: String,
pub password: String, pub password: String,
@ -360,7 +360,7 @@ impl AuthCache {
} }
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AuthCache { pub struct AuthCache {
pub version: u32, pub version: u32,
pub entries: HashMap<String, AuthCacheEntry>, pub entries: HashMap<String, AuthCacheEntry>,

View file

@ -19,7 +19,7 @@ pub type FileOrigin = String;
/// Relative slice positions of a sequence, /// Relative slice positions of a sequence,
/// whose semantic should be consistent with (start, end) parameters in /// whose semantic should be consistent with (start, end) parameters in
/// <https://w3c.github.io/FileAPI/#dfn-slice> /// <https://w3c.github.io/FileAPI/#dfn-slice>
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct RelativePos { pub struct RelativePos {
/// Relative to first byte if non-negative, /// Relative to first byte if non-negative,
/// relative to one past last byte if negative, /// relative to one past last byte if negative,
@ -111,7 +111,7 @@ pub struct SelectedFile {
pub type_string: String, pub type_string: String,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum FileManagerThreadMsg { pub enum FileManagerThreadMsg {
/// Select a single file. Last field is pre-selected file path for testing /// Select a single file. Last field is pre-selected file path for testing
SelectFile(Vec<FilterPattern>, IpcSender<FileManagerResult<SelectedFile>>, FileOrigin, Option<String>), SelectFile(Vec<FilterPattern>, IpcSender<FileManagerResult<SelectedFile>>, FileOrigin, Option<String>),

View file

@ -16,14 +16,14 @@ use webrender_api;
/// Whether a consumer is in a position to request images or not. This can occur /// Whether a consumer is in a position to request images or not. This can occur
/// when animations are being processed by the layout thread while the script /// when animations are being processed by the layout thread while the script
/// thread is executing in parallel. /// thread is executing in parallel.
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum CanRequestImages { pub enum CanRequestImages {
No, No,
Yes, Yes,
} }
/// Indicating either entire image or just metadata availability /// Indicating either entire image or just metadata availability
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub enum ImageOrMetadataAvailable { pub enum ImageOrMetadataAvailable {
ImageAvailable(#[ignore_malloc_size_of = "Arc"] Arc<Image>, ServoUrl), ImageAvailable(#[ignore_malloc_size_of = "Arc"] Arc<Image>, ServoUrl),
MetadataAvailable(ImageMetadata), MetadataAvailable(ImageMetadata),
@ -33,7 +33,7 @@ pub enum ImageOrMetadataAvailable {
/// and image, and returned to the specified event loop when the /// and image, and returned to the specified event loop when the
/// image load completes. It is typically used to trigger a reflow /// image load completes. It is typically used to trigger a reflow
/// and/or repaint. /// and/or repaint.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ImageResponder { pub struct ImageResponder {
id: PendingImageId, id: PendingImageId,
sender: IpcSender<PendingImageResponse>, sender: IpcSender<PendingImageResponse>,
@ -73,7 +73,7 @@ pub enum ImageResponse {
} }
/// The current state of an image in the cache. /// The current state of an image in the cache.
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum ImageState { pub enum ImageState {
Pending(PendingImageId), Pending(PendingImageId),
LoadError, LoadError,
@ -90,7 +90,7 @@ pub struct PendingImageResponse {
pub id: PendingImageId, pub id: PendingImageId,
} }
#[derive(Clone, Copy, Deserialize, Eq, Hash, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum UsePlaceholder { pub enum UsePlaceholder {
No, No,
Yes, Yes,

View file

@ -62,7 +62,7 @@ pub mod image {
/// A loading context, for context-specific sniffing, as defined in /// A loading context, for context-specific sniffing, as defined in
/// <https://mimesniff.spec.whatwg.org/#context-specific-sniffing> /// <https://mimesniff.spec.whatwg.org/#context-specific-sniffing>
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub enum LoadContext { pub enum LoadContext {
Browsing, Browsing,
Image, Image,
@ -98,7 +98,7 @@ impl CustomResponse {
} }
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CustomResponseMediator { pub struct CustomResponseMediator {
pub response_chan: IpcSender<Option<CustomResponse>>, pub response_chan: IpcSender<Option<CustomResponse>>,
pub load_url: ServoUrl, pub load_url: ServoUrl,
@ -149,7 +149,7 @@ impl<'a> From<&'a ReferrerPolicyHeader> for ReferrerPolicy {
} }
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum FetchResponseMsg { pub enum FetchResponseMsg {
// todo: should have fields for transmitted/total bytes // todo: should have fields for transmitted/total bytes
ProcessRequestBody, ProcessRequestBody,
@ -185,7 +185,7 @@ pub trait FetchTaskTarget {
fn process_response_eof(&mut self, response: &Response); fn process_response_eof(&mut self, response: &Response);
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum FilteredMetadata { pub enum FilteredMetadata {
Basic(Metadata), Basic(Metadata),
Cors(Metadata), Cors(Metadata),
@ -193,7 +193,7 @@ pub enum FilteredMetadata {
OpaqueRedirect OpaqueRedirect
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum FetchMetadata { pub enum FetchMetadata {
Unfiltered(Metadata), Unfiltered(Metadata),
Filtered { Filtered {
@ -276,7 +276,7 @@ pub trait IpcSend<T>
// the "Arc" hack implicitly in future. // the "Arc" hack implicitly in future.
// See discussion: http://logs.glob.uno/?c=mozilla%23servo&s=16+May+2016&e=16+May+2016#c430412 // See discussion: http://logs.glob.uno/?c=mozilla%23servo&s=16+May+2016&e=16+May+2016#c430412
// See also: https://github.com/servo/servo/blob/735480/components/script/script_thread.rs#L313 // See also: https://github.com/servo/servo/blob/735480/components/script/script_thread.rs#L313
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ResourceThreads { pub struct ResourceThreads {
core_thread: CoreResourceThread, core_thread: CoreResourceThread,
storage_thread: IpcSender<StorageThreadMsg>, storage_thread: IpcSender<StorageThreadMsg>,
@ -314,25 +314,25 @@ impl IpcSend<StorageThreadMsg> for ResourceThreads {
// Ignore the sub-fields // Ignore the sub-fields
malloc_size_of_is_0!(ResourceThreads); malloc_size_of_is_0!(ResourceThreads);
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum IncludeSubdomains { pub enum IncludeSubdomains {
Included, Included,
NotIncluded, NotIncluded,
} }
#[derive(Deserialize, MallocSizeOf, Serialize)] #[derive(Debug, Deserialize, MallocSizeOf, Serialize)]
pub enum MessageData { pub enum MessageData {
Text(String), Text(String),
Binary(Vec<u8>), Binary(Vec<u8>),
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebSocketDomAction { pub enum WebSocketDomAction {
SendMessage(MessageData), SendMessage(MessageData),
Close(Option<u16>, Option<String>), Close(Option<u16>, Option<String>),
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebSocketNetworkEvent { pub enum WebSocketNetworkEvent {
ConnectionEstablished { ConnectionEstablished {
protocol_in_use: Option<String>, protocol_in_use: Option<String>,
@ -342,7 +342,7 @@ pub enum WebSocketNetworkEvent {
Fail, Fail,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
/// IPC channels to communicate with the script thread about network or DOM events. /// IPC channels to communicate with the script thread about network or DOM events.
pub enum FetchChannels { pub enum FetchChannels {
ResponseMsg(IpcSender<FetchResponseMsg>, /* cancel_chan */ Option<IpcReceiver<()>>), ResponseMsg(IpcSender<FetchResponseMsg>, /* cancel_chan */ Option<IpcReceiver<()>>),
@ -352,7 +352,7 @@ pub enum FetchChannels {
} }
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum CoreResourceMsg { pub enum CoreResourceMsg {
Fetch(RequestInit, FetchChannels), Fetch(RequestInit, FetchChannels),
/// Initiate a fetch in response to processing a redirection /// Initiate a fetch in response to processing a redirection
@ -393,7 +393,7 @@ pub fn fetch_async<F>(request: RequestInit, core_resource_thread: &CoreResourceT
CoreResourceMsg::Fetch(request, FetchChannels::ResponseMsg(action_sender, None))).unwrap(); CoreResourceMsg::Fetch(request, FetchChannels::ResponseMsg(action_sender, None))).unwrap();
} }
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct ResourceCorsData { pub struct ResourceCorsData {
/// CORS Preflight flag /// CORS Preflight flag
pub preflight: bool, pub preflight: bool,
@ -402,7 +402,7 @@ pub struct ResourceCorsData {
} }
/// Metadata about a loaded resource, such as is obtained from HTTP headers. /// Metadata about a loaded resource, such as is obtained from HTTP headers.
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct Metadata { pub struct Metadata {
/// Final URL after redirects. /// Final URL after redirects.
pub final_url: ServoUrl, pub final_url: ServoUrl,
@ -471,7 +471,7 @@ impl Metadata {
} }
/// The creator of a given cookie /// The creator of a given cookie
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum CookieSource { pub enum CookieSource {
/// An HTTP API /// An HTTP API
HTTP, HTTP,

View file

@ -20,7 +20,7 @@ pub enum Initiator {
} }
/// A request [destination](https://fetch.spec.whatwg.org/#concept-request-destination) /// A request [destination](https://fetch.spec.whatwg.org/#concept-request-destination)
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum Destination { pub enum Destination {
None, None,
Audio, Audio,
@ -60,7 +60,7 @@ pub enum Origin {
} }
/// A [referer](https://fetch.spec.whatwg.org/#concept-request-referrer) /// A [referer](https://fetch.spec.whatwg.org/#concept-request-referrer)
#[derive(Clone, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum Referrer { pub enum Referrer {
NoReferrer, NoReferrer,
/// Default referrer if nothing is specified /// Default referrer if nothing is specified
@ -69,7 +69,7 @@ pub enum Referrer {
} }
/// A [request mode](https://fetch.spec.whatwg.org/#concept-request-mode) /// A [request mode](https://fetch.spec.whatwg.org/#concept-request-mode)
#[derive(Clone, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum RequestMode { pub enum RequestMode {
Navigate, Navigate,
SameOrigin, SameOrigin,
@ -79,7 +79,7 @@ pub enum RequestMode {
} }
/// Request [credentials mode](https://fetch.spec.whatwg.org/#concept-request-credentials-mode) /// Request [credentials mode](https://fetch.spec.whatwg.org/#concept-request-credentials-mode)
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum CredentialsMode { pub enum CredentialsMode {
Omit, Omit,
CredentialsSameOrigin, CredentialsSameOrigin,
@ -87,7 +87,7 @@ pub enum CredentialsMode {
} }
/// [Cache mode](https://fetch.spec.whatwg.org/#concept-request-cache-mode) /// [Cache mode](https://fetch.spec.whatwg.org/#concept-request-cache-mode)
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum CacheMode { pub enum CacheMode {
Default, Default,
NoStore, NoStore,
@ -98,7 +98,7 @@ pub enum CacheMode {
} }
/// [Service-workers mode](https://fetch.spec.whatwg.org/#request-service-workers-mode) /// [Service-workers mode](https://fetch.spec.whatwg.org/#request-service-workers-mode)
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum ServiceWorkersMode { pub enum ServiceWorkersMode {
All, All,
Foreign, Foreign,
@ -106,7 +106,7 @@ pub enum ServiceWorkersMode {
} }
/// [Redirect mode](https://fetch.spec.whatwg.org/#concept-request-redirect-mode) /// [Redirect mode](https://fetch.spec.whatwg.org/#concept-request-redirect-mode)
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum RedirectMode { pub enum RedirectMode {
Follow, Follow,
Error, Error,
@ -129,13 +129,13 @@ pub enum Window {
} }
/// [CORS settings attribute](https://html.spec.whatwg.org/multipage/#attr-crossorigin-anonymous) /// [CORS settings attribute](https://html.spec.whatwg.org/multipage/#attr-crossorigin-anonymous)
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum CorsSettings { pub enum CorsSettings {
Anonymous, Anonymous,
UseCredentials, UseCredentials,
} }
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct RequestInit { pub struct RequestInit {
#[serde(deserialize_with = "::hyper_serde::deserialize", #[serde(deserialize_with = "::hyper_serde::deserialize",
serialize_with = "::hyper_serde::serialize")] serialize_with = "::hyper_serde::serialize")]

View file

@ -75,7 +75,7 @@ pub enum ResponseMsg {
Errored, Errored,
} }
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct ResponseInit { pub struct ResponseInit {
pub url: ServoUrl, pub url: ServoUrl,
#[serde(deserialize_with = "::hyper_serde::deserialize", #[serde(deserialize_with = "::hyper_serde::deserialize",

View file

@ -5,14 +5,14 @@
use ipc_channel::ipc::IpcSender; use ipc_channel::ipc::IpcSender;
use servo_url::ServoUrl; use servo_url::ServoUrl;
#[derive(Clone, Copy, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, Serialize)]
pub enum StorageType { pub enum StorageType {
Session, Session,
Local, Local,
} }
/// Request operations on the storage data associated with a particular url /// Request operations on the storage data associated with a particular url
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum StorageThreadMsg { pub enum StorageThreadMsg {
/// gets the number of key/value pairs present in the associated storage data /// gets the number of key/value pairs present in the associated storage data
Length(IpcSender<usize>, ServoUrl, StorageType), Length(IpcSender<usize>, ServoUrl, StorageType),

View file

@ -45,7 +45,7 @@ where
/// Front-end representation of the profiler used to communicate with the /// Front-end representation of the profiler used to communicate with the
/// profiler. /// profiler.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ProfilerChan(pub IpcSender<ProfilerMsg>); pub struct ProfilerChan(pub IpcSender<ProfilerMsg>);
impl ProfilerChan { impl ProfilerChan {
@ -102,7 +102,7 @@ impl ProfilerChan {
/// and thread stacks. "explicit" is not guaranteed to cover every explicit allocation, but it does /// and thread stacks. "explicit" is not guaranteed to cover every explicit allocation, but it does
/// cover most (including the entire heap), and therefore it is the single best number to focus on /// cover most (including the entire heap), and therefore it is the single best number to focus on
/// when trying to reduce memory usage. /// when trying to reduce memory usage.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum ReportKind { pub enum ReportKind {
/// A size measurement for an explicit allocation on the jemalloc heap. This should be used /// A size measurement for an explicit allocation on the jemalloc heap. This should be used
/// for any measurements done via the `MallocSizeOf` trait. /// for any measurements done via the `MallocSizeOf` trait.
@ -126,7 +126,7 @@ pub enum ReportKind {
} }
/// A single memory-related measurement. /// A single memory-related measurement.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct Report { pub struct Report {
/// The identifying path for this report. /// The identifying path for this report.
pub path: Vec<String>, pub path: Vec<String>,
@ -139,7 +139,7 @@ pub struct Report {
} }
/// A channel through which memory reports can be sent. /// A channel through which memory reports can be sent.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ReportsChan(pub IpcSender<Vec<Report>>); pub struct ReportsChan(pub IpcSender<Vec<Report>>);
impl ReportsChan { impl ReportsChan {
@ -152,7 +152,7 @@ impl ReportsChan {
} }
/// The protocol used to send reporter requests. /// The protocol used to send reporter requests.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct ReporterRequest { pub struct ReporterRequest {
/// The channel on which reports are to be sent. /// The channel on which reports are to be sent.
pub reports_channel: ReportsChan, pub reports_channel: ReportsChan,
@ -165,7 +165,7 @@ pub struct ReporterRequest {
/// In many cases, clients construct `Reporter` objects by creating an IPC sender/receiver pair and /// In many cases, clients construct `Reporter` objects by creating an IPC sender/receiver pair and
/// registering the receiving end with the router so that messages from the memory profiler end up /// registering the receiving end with the router so that messages from the memory profiler end up
/// injected into the client's event loop. /// injected into the client's event loop.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct Reporter(pub IpcSender<ReporterRequest>); pub struct Reporter(pub IpcSender<ReporterRequest>);
impl Reporter { impl Reporter {
@ -188,7 +188,7 @@ macro_rules! path {
} }
/// Messages that can be sent to the memory profiler thread. /// Messages that can be sent to the memory profiler thread.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum ProfilerMsg { pub enum ProfilerMsg {
/// Register a Reporter with the memory profiler. The String is only used to identify the /// Register a Reporter with the memory profiler. The String is only used to identify the
/// reporter so it can be unregistered later. The String must be distinct from that used by any /// reporter so it can be unregistered later. The String must be distinct from that used by any

View file

@ -17,7 +17,7 @@ pub struct TimerMetadata {
pub incremental: TimerMetadataReflowType, pub incremental: TimerMetadataReflowType,
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ProfilerChan(pub IpcSender<ProfilerMsg>); pub struct ProfilerChan(pub IpcSender<ProfilerMsg>);
impl ProfilerChan { impl ProfilerChan {
@ -28,13 +28,13 @@ impl ProfilerChan {
} }
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum ProfilerData { pub enum ProfilerData {
NoRecords, NoRecords,
Record(Vec<f64>), Record(Vec<f64>),
} }
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum ProfilerMsg { pub enum ProfilerMsg {
/// Normal message used for reporting time /// Normal message used for reporting time
Time( Time(

View file

@ -112,7 +112,7 @@ impl UntrustedNodeAddress {
} }
/// Messages sent to the layout thread from the constellation and/or compositor. /// Messages sent to the layout thread from the constellation and/or compositor.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum LayoutControlMsg { pub enum LayoutControlMsg {
/// Requests that this layout thread exit. /// Requests that this layout thread exit.
ExitNow, ExitNow,
@ -191,7 +191,7 @@ impl LoadData {
} }
/// The initial data required to create a new layout attached to an existing script thread. /// The initial data required to create a new layout attached to an existing script thread.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct NewLayoutInfo { pub struct NewLayoutInfo {
/// The ID of the parent pipeline and frame type, if any. /// The ID of the parent pipeline and frame type, if any.
/// If `None`, this is a root pipeline. /// If `None`, this is a root pipeline.
@ -217,7 +217,7 @@ pub struct NewLayoutInfo {
} }
/// When a pipeline is closed, should its browsing context be discarded too? /// When a pipeline is closed, should its browsing context be discarded too?
#[derive(Clone, Copy, Deserialize, Eq, Hash, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum DiscardBrowsingContext { pub enum DiscardBrowsingContext {
/// Discard the browsing context /// Discard the browsing context
Yes, Yes,
@ -446,7 +446,7 @@ pub enum MouseButton {
} }
/// The types of mouse events /// The types of mouse events
#[derive(Deserialize, MallocSizeOf, Serialize)] #[derive(Debug, Deserialize, MallocSizeOf, Serialize)]
pub enum MouseEventType { pub enum MouseEventType {
/// Mouse button clicked /// Mouse button clicked
Click, Click,
@ -457,7 +457,7 @@ pub enum MouseEventType {
} }
/// Events from the compositor that the script thread needs to know about /// Events from the compositor that the script thread needs to know about
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum CompositorEvent { pub enum CompositorEvent {
/// The window was resized. /// The window was resized.
ResizeEvent(WindowSizeData, WindowSizeType), ResizeEvent(WindowSizeData, WindowSizeType),
@ -483,7 +483,7 @@ pub enum CompositorEvent {
} }
/// Requests a TimerEvent-Message be sent after the given duration. /// Requests a TimerEvent-Message be sent after the given duration.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct TimerEventRequest( pub struct TimerEventRequest(
pub IpcSender<TimerEvent>, pub IpcSender<TimerEvent>,
pub TimerSource, pub TimerSource,
@ -492,7 +492,7 @@ pub struct TimerEventRequest(
); );
/// Type of messages that can be sent to the timer scheduler. /// Type of messages that can be sent to the timer scheduler.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum TimerSchedulerMsg { pub enum TimerSchedulerMsg {
/// Message to schedule a new timer event. /// Message to schedule a new timer event.
Request(TimerEventRequest), Request(TimerEventRequest),
@ -616,7 +616,7 @@ pub enum IFrameSandboxState {
} }
/// Specifies the information required to load an auxiliary browsing context. /// Specifies the information required to load an auxiliary browsing context.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct AuxiliaryBrowsingContextLoadInfo { pub struct AuxiliaryBrowsingContextLoadInfo {
/// The pipeline opener browsing context. /// The pipeline opener browsing context.
pub opener_pipeline_id: PipelineId, pub opener_pipeline_id: PipelineId,
@ -629,7 +629,7 @@ pub struct AuxiliaryBrowsingContextLoadInfo {
} }
/// Specifies the information required to load an iframe. /// Specifies the information required to load an iframe.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct IFrameLoadInfo { pub struct IFrameLoadInfo {
/// Pipeline ID of the parent of this iframe /// Pipeline ID of the parent of this iframe
pub parent_pipeline_id: PipelineId, pub parent_pipeline_id: PipelineId,
@ -647,7 +647,7 @@ pub struct IFrameLoadInfo {
} }
/// Specifies the information required to load a URL in an iframe. /// Specifies the information required to load a URL in an iframe.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub struct IFrameLoadInfoWithData { pub struct IFrameLoadInfoWithData {
/// The information required to load an iframe. /// The information required to load an iframe.
pub info: IFrameLoadInfo, pub info: IFrameLoadInfo,
@ -660,7 +660,7 @@ pub struct IFrameLoadInfoWithData {
} }
/// Specifies whether the script or layout thread needs to be ticked for animation. /// Specifies whether the script or layout thread needs to be ticked for animation.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum AnimationTickType { pub enum AnimationTickType {
/// The script thread. /// The script thread.
Script, Script,
@ -678,7 +678,7 @@ pub struct ScrollState {
} }
/// Data about the window size. /// Data about the window size.
#[derive(Clone, Copy, Deserialize, MallocSizeOf, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct WindowSizeData { pub struct WindowSizeData {
/// The size of the initial layout viewport, before parsing an /// The size of the initial layout viewport, before parsing an
/// <http://www.w3.org/TR/css-device-adapt/#initial-viewport> /// <http://www.w3.org/TR/css-device-adapt/#initial-viewport>
@ -689,7 +689,7 @@ pub struct WindowSizeData {
} }
/// The type of window size change. /// The type of window size change.
#[derive(Clone, Copy, Deserialize, Eq, MallocSizeOf, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, MallocSizeOf, PartialEq, Serialize)]
pub enum WindowSizeType { pub enum WindowSizeType {
/// Initial load. /// Initial load.
Initial, Initial,
@ -698,7 +698,7 @@ pub enum WindowSizeType {
} }
/// Messages to the constellation originating from the WebDriver server. /// Messages to the constellation originating from the WebDriver server.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverCommandMsg { pub enum WebDriverCommandMsg {
/// Get the window size. /// Get the window size.
GetWindowSize(TopLevelBrowsingContextId, IpcSender<WindowSizeData>), GetWindowSize(TopLevelBrowsingContextId, IpcSender<WindowSizeData>),
@ -803,7 +803,7 @@ impl fmt::Debug for ConstellationMsg {
} }
/// Resources required by workerglobalscopes /// Resources required by workerglobalscopes
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct WorkerGlobalScopeInit { pub struct WorkerGlobalScopeInit {
/// Chan to a resource thread /// Chan to a resource thread
pub resource_threads: ResourceThreads, pub resource_threads: ResourceThreads,
@ -828,7 +828,7 @@ pub struct WorkerGlobalScopeInit {
} }
/// Common entities representing a network load origin /// Common entities representing a network load origin
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct WorkerScriptLoadOrigin { pub struct WorkerScriptLoadOrigin {
/// referrer url /// referrer url
pub referrer_url: Option<ServoUrl>, pub referrer_url: Option<ServoUrl>,
@ -885,7 +885,7 @@ pub struct DrawAPaintImageResult {
} }
/// A Script to Constellation channel. /// A Script to Constellation channel.
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ScriptToConstellationChan { pub struct ScriptToConstellationChan {
/// Sender for communicating with constellation thread. /// Sender for communicating with constellation thread.
pub sender: IpcSender<(PipelineId, ScriptMsg)>, pub sender: IpcSender<(PipelineId, ScriptMsg)>,

View file

@ -61,7 +61,7 @@ impl fmt::Debug for LayoutMsg {
} }
/// Whether a DOM event was prevented by web content /// Whether a DOM event was prevented by web content
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum EventResult { pub enum EventResult {
/// Allowed by web content /// Allowed by web content
DefaultAllowed, DefaultAllowed,
@ -241,7 +241,7 @@ impl fmt::Debug for ScriptMsg {
} }
/// Entities required to spawn service workers /// Entities required to spawn service workers
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ScopeThings { pub struct ScopeThings {
/// script resource url /// script resource url
pub script_url: ServoUrl, pub script_url: ServoUrl,
@ -268,7 +268,7 @@ pub struct SWManagerSenders {
} }
/// Messages sent to Service Worker Manager thread /// Messages sent to Service Worker Manager thread
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum ServiceWorkerMsg { pub enum ServiceWorkerMsg {
/// Message to register the service worker /// Message to register the service worker
RegisterServiceWorker(ScopeThings, ServoUrl), RegisterServiceWorker(ScopeThings, ServoUrl),
@ -281,7 +281,7 @@ pub enum ServiceWorkerMsg {
} }
/// Messages outgoing from the Service Worker Manager thread to constellation /// Messages outgoing from the Service Worker Manager thread to constellation
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum SWManagerMsg { pub enum SWManagerMsg {
/// Provide the constellation with a means of communicating with the Service Worker Manager /// Provide the constellation with a means of communicating with the Service Worker Manager
OwnSender(IpcSender<ServiceWorkerMsg>), OwnSender(IpcSender<ServiceWorkerMsg>),

View file

@ -12,7 +12,7 @@ use msg::constellation_msg::BrowsingContextId;
use rustc_serialize::json::{Json, ToJson}; use rustc_serialize::json::{Json, ToJson};
use servo_url::ServoUrl; use servo_url::ServoUrl;
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverScriptCommand { pub enum WebDriverScriptCommand {
AddCookie( AddCookie(
#[serde( #[serde(
@ -42,13 +42,13 @@ pub enum WebDriverScriptCommand {
GetTitle(IpcSender<String>), GetTitle(IpcSender<String>),
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverCookieError { pub enum WebDriverCookieError {
InvalidDomain, InvalidDomain,
UnableToSetCookie, UnableToSetCookie,
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverJSValue { pub enum WebDriverJSValue {
Undefined, Undefined,
Null, Null,
@ -57,7 +57,7 @@ pub enum WebDriverJSValue {
String(String), // TODO: Object and WebElement String(String), // TODO: Object and WebElement
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverJSError { pub enum WebDriverJSError {
Timeout, Timeout,
UnknownType, UnknownType,
@ -68,7 +68,7 @@ pub enum WebDriverJSError {
pub type WebDriverJSResult = Result<WebDriverJSValue, WebDriverJSError>; pub type WebDriverJSResult = Result<WebDriverJSValue, WebDriverJSError>;
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverFrameId { pub enum WebDriverFrameId {
Short(u16), Short(u16),
Element(String), Element(String),
@ -87,7 +87,7 @@ impl ToJson for WebDriverJSValue {
} }
} }
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum LoadStatus { pub enum LoadStatus {
LoadComplete, LoadComplete,
LoadTimeout, LoadTimeout,

View file

@ -9,7 +9,7 @@ use webvr::*;
pub type WebVRResult<T> = Result<T, String>; pub type WebVRResult<T> = Result<T, String>;
// Messages from Script thread to WebVR thread. // Messages from Script thread to WebVR thread.
#[derive(Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
pub enum WebVRMsg { pub enum WebVRMsg {
RegisterContext(PipelineId), RegisterContext(PipelineId),
UnregisterContext(PipelineId), UnregisterContext(PipelineId),