Document the use and meaning of the devtools control messages. Fixes #6922.

This commit is contained in:
Josh Matthews 2015-08-10 12:35:31 -04:00
parent 9c528c6382
commit 47b9e89c66

View file

@ -46,25 +46,38 @@ pub struct DevtoolsPageInfo {
pub url: Url
}
/// Messages to the instruct the devtools server to update its known actors/state
/// Messages to instruct the devtools server to update its known actors/state
/// according to changes in the browser.
pub enum DevtoolsControlMsg {
/// Messages from tasks in the chrome process (resource/constellation/devtools)
FromChrome(ChromeToDevtoolsControlMsg),
/// Messages from script tasks
FromScript(ScriptToDevtoolsControlMsg),
}
/// Events that the devtools server must act upon.
pub enum ChromeToDevtoolsControlMsg {
/// A new client has connected to the server.
AddClient(TcpStream),
/// An animation frame with the given timestamp was processed in a script task.
/// The actor with the provided name should be notified.
FramerateTick(String, f64),
/// The browser is shutting down.
ServerExitMsg,
/// A network event occurred (request, reply, etc.). The actor with the
/// provided name should be notified.
NetworkEvent(String, NetworkEvent),
}
#[derive(Deserialize, Serialize)]
/// Events that the devtools server must act upon.
pub enum ScriptToDevtoolsControlMsg {
/// A new global object was created, associated with a particular pipeline.
/// The means of communicating directly with it are provided.
NewGlobal((PipelineId, Option<WorkerId>),
IpcSender<DevtoolScriptControlMsg>,
DevtoolsPageInfo),
/// A particular page has invoked the console API.
ConsoleAPI(PipelineId, ConsoleMessage, Option<WorkerId>),
}