diff options
author | Connor Brewster <connor.brewster@eagles.oc.edu> | 2018-05-11 11:01:51 -0600 |
---|---|---|
committer | Connor Brewster <connor.brewster@eagles.oc.edu> | 2018-05-18 14:53:04 -0600 |
commit | ee3c26c56c7e352571bc6cc8bb66ab20404bdafa (patch) | |
tree | 38a6b7bc28d950425d3468e05b8874ef9eeebe71 /components/script_traits/script_msg.rs | |
parent | a8bdd44ecea6dc6cd553f80e31d1705e3f34c559 (diff) | |
download | servo-ee3c26c56c7e352571bc6cc8bb66ab20404bdafa.tar.gz servo-ee3c26c56c7e352571bc6cc8bb66ab20404bdafa.zip |
Cleanup constellation debug messages
Diffstat (limited to 'components/script_traits/script_msg.rs')
-rw-r--r-- | components/script_traits/script_msg.rs | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index d64d47b3eb0..ad437b09d8d 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -22,6 +22,7 @@ use net_traits::request::RequestInit; use net_traits::storage_thread::StorageType; use servo_url::ImmutableOrigin; use servo_url::ServoUrl; +use std::fmt; use style_traits::CSSPixel; use style_traits::cursor::CursorKind; use style_traits::viewport::ViewportConstraints; @@ -43,6 +44,20 @@ pub enum LayoutMsg { ViewportConstrained(PipelineId, ViewportConstraints), } +impl fmt::Debug for LayoutMsg { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + use self::LayoutMsg::*; + let variant = match *self { + ChangeRunningAnimationsState(..) => "ChangeRunningAnimationsState", + IFrameSizes(..) => "IFrameSizes", + PendingPaintMetric(..) => "PendingPaintMetric", + SetCursor(..) => "SetCursor", + ViewportConstrained(..) => "ViewportConstrained", + }; + write!(formatter, "LayoutMsg::{}", variant) + } +} + /// Whether a DOM event was prevented by web content #[derive(Deserialize, Serialize)] pub enum EventResult { @@ -172,6 +187,62 @@ pub enum ScriptMsg { Exit, } +impl fmt::Debug for ScriptMsg { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + use self::ScriptMsg::*; + let variant = match *self { + InitiateNavigateRequest(..) => "InitiateNavigateRequest", + BroadcastStorageEvent(..) => "BroadcastStorageEvent", + ChangeRunningAnimationsState(..) => "ChangeRunningAnimationsState", + CreateCanvasPaintThread(..) => "CreateCanvasPaintThread", + Focus => "Focus", + GetClipboardContents(..) => "GetClipboardContents", + GetBrowsingContextId(..) => "GetBrowsingContextId", + GetParentInfo(..) => "GetParentInfo", + GetChildBrowsingContextId(..) => "GetChildBrowsingContextId", + HeadParsed => "HeadParsed", + LoadComplete => "LoadComplete", + LoadUrl(..) => "LoadUrl", + AbortLoadUrl => "AbortLoadUrl", + PostMessage(..) => "PostMessage", + TraverseHistory(..) => "TraverseHistory", + PushHistoryState(..) => "PushHistoryState", + ReplaceHistoryState(..) => "ReplaceHistoryState", + JointSessionHistoryLength(..) => "JointSessionHistoryLength", + NewFavicon(..) => "NewFavicon", + NodeStatus(..) => "NodeStatus", + RemoveIFrame(..) => "RemoveIFrame", + SetVisible(..) => "SetVisible", + VisibilityChangeComplete(..) => "VisibilityChangeComplete", + ScriptLoadedURLInIFrame(..) => "ScriptLoadedURLInIFrame", + ScriptNewIFrame(..) => "ScriptNewIFrame", + SetClipboardContents(..) => "SetClipboardContents", + ActivateDocument => "ActivateDocument", + SetDocumentState(..) => "SetDocumentState", + SetFinalUrl(..) => "SetFinalUrl", + Alert(..) => "Alert", + SetTitle(..) => "SetTitle", + SendKeyEvent(..) => "SendKeyEvent", + MoveTo(..) => "MoveTo", + ResizeTo(..) => "ResizeTo", + TouchEventProcessed(..) => "TouchEventProcessed", + LogEntry(..) => "LogEntry", + DiscardDocument => "DiscardDocument", + PipelineExited => "PipelineExited", + ForwardDOMMessage(..) => "ForwardDOMMessage", + RegisterServiceWorker(..) => "RegisterServiceWorker", + SetFullscreenState(..) => "SetFullscreenState", + GetClientWindow(..) => "GetClientWindow", + GetScreenSize(..) => "GetScreenSize", + GetScreenAvailSize(..) => "GetScreenAvailSize", + ShowIME(..) => "ShowIME", + HideIME => "HideIME", + Exit => "Exit", + }; + write!(formatter, "ScriptMsg::{}", variant) + } +} + /// Entities required to spawn service workers #[derive(Clone, Deserialize, Serialize)] pub struct ScopeThings { |