diff options
Diffstat (limited to 'components/devtools_traits/lib.rs')
-rw-r--r-- | components/devtools_traits/lib.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs index 659c6983e36..54411122271 100644 --- a/components/devtools_traits/lib.rs +++ b/components/devtools_traits/lib.rs @@ -9,13 +9,12 @@ #![crate_name = "devtools_traits"] #![crate_type = "rlib"] -#![feature(net)] - #![allow(non_snake_case)] extern crate msg; -extern crate "rustc-serialize" as rustc_serialize; +extern crate rustc_serialize; extern crate url; +extern crate hyper; extern crate util; extern crate time; @@ -24,6 +23,10 @@ use msg::constellation_msg::{PipelineId, WorkerId}; use util::str::DOMString; use url::Url; +use hyper::header::Headers; +use hyper::http::RawStatus; +use hyper::method::Method; + use std::net::TcpStream; use std::sync::mpsc::{Sender, Receiver}; @@ -41,9 +44,11 @@ pub struct DevtoolsPageInfo { /// according to changes in the browser. pub enum DevtoolsControlMsg { AddClient(TcpStream), + FramerateTick(String, f64), NewGlobal((PipelineId, Option<WorkerId>), Sender<DevtoolScriptControlMsg>, DevtoolsPageInfo), SendConsoleMessage(PipelineId, ConsoleMessage), - ServerExitMsg + ServerExitMsg, + NetworkEventMessage(String, NetworkEvent), } /// Serialized JS return values @@ -117,6 +122,7 @@ pub enum DevtoolScriptControlMsg { WantsLiveNotifications(PipelineId, bool), SetTimelineMarkers(PipelineId, Vec<TimelineMarkerType>, Sender<TimelineMarker>), DropTimelineMarkers(PipelineId, Vec<TimelineMarkerType>), + RequestAnimationFrame(PipelineId, Box<Fn(f64, ) + Send>), } #[derive(RustcEncodable)] @@ -147,6 +153,12 @@ pub enum ConsoleMessage { //WarnMessage(String), } +#[derive(Clone)] +pub enum NetworkEvent { + HttpRequest(Url, Method, Headers, Option<Vec<u8>>), + HttpResponse(Option<Headers>, Option<RawStatus>, Option<Vec<u8>>) +} + impl TimelineMarker { pub fn new(name: String, metadata: TracingMetadata) -> TimelineMarker { TimelineMarker { |