mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Sent log messages to the constellation.
This commit is contained in:
parent
175340d146
commit
44422744ff
11 changed files with 229 additions and 18 deletions
|
@ -66,7 +66,7 @@ use url::Url;
|
|||
use util::ipc::OptionalOpaqueIpcSender;
|
||||
use webdriver_msg::{LoadStatus, WebDriverScriptCommand};
|
||||
|
||||
pub use script_msg::{LayoutMsg, ScriptMsg, EventResult};
|
||||
pub use script_msg::{LayoutMsg, ScriptMsg, EventResult, LogEntry};
|
||||
|
||||
/// The address of a node. Layout sends these back. They must be validated via
|
||||
/// `from_untrusted_node_address` before they can be used, because we do not trust layout.
|
||||
|
@ -436,6 +436,7 @@ pub enum MozBrowserEvent {
|
|||
/// handling `<menuitem>` element available within the browser `<iframe>`'s content.
|
||||
ContextMenu,
|
||||
/// Sent when an error occurred while trying to load content within a browser `<iframe>`.
|
||||
/// Includes an optional human-readable description, and an optional machine-readable report.
|
||||
Error(MozBrowserErrorType, Option<String>, Option<String>),
|
||||
/// Sent when the favicon of a browser `<iframe>` changes.
|
||||
IconChange(String, String, String),
|
||||
|
@ -599,4 +600,6 @@ pub enum ConstellationMsg {
|
|||
WebDriverCommand(WebDriverCommandMsg),
|
||||
/// Reload the current page.
|
||||
Reload,
|
||||
/// A log entry, with the pipeline id and thread name
|
||||
LogEntry(Option<PipelineId>, Option<String>, LogEntry),
|
||||
}
|
||||
|
|
|
@ -40,6 +40,19 @@ pub enum EventResult {
|
|||
DefaultPrevented,
|
||||
}
|
||||
|
||||
/// A log entry reported to the constellation
|
||||
/// We don't report all log entries, just serious ones.
|
||||
/// We need a separate type for this because LogLevel isn't serializable.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub enum LogEntry {
|
||||
/// Panic, with a reason and backtrace
|
||||
Panic(String, String),
|
||||
/// Error, with a reason
|
||||
Error(String),
|
||||
/// warning, with a reason
|
||||
Warn(String)
|
||||
}
|
||||
|
||||
/// Messages from the script to the constellation.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum ScriptMsg {
|
||||
|
@ -114,6 +127,8 @@ pub enum ScriptMsg {
|
|||
TouchEventProcessed(EventResult),
|
||||
/// Get Scroll Offset
|
||||
GetScrollOffset(PipelineId, LayerId, IpcSender<Point2D<f32>>),
|
||||
/// A log entry, with the pipeline id and thread name
|
||||
LogEntry(Option<PipelineId>, Option<String>, LogEntry),
|
||||
/// Notifies the constellation that this pipeline has exited.
|
||||
PipelineExited(PipelineId),
|
||||
/// Requests that the compositor shut down.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue