1. Add an enum type NetworkEventMessage for handling both HttpRequest and HttpResponse messages

2. Change run_server to handle network events
3. Add a unique id to track request-actor associations
4. Update the network event actor
This commit is contained in:
Himaja 2015-04-26 20:51:46 -04:00 committed by Josh Matthews
parent 9f4a88bc48
commit 6e91ebb1fe
5 changed files with 230 additions and 72 deletions

View file

@ -47,8 +47,7 @@ pub enum DevtoolsControlMsg {
NewGlobal((PipelineId, Option<WorkerId>), Sender<DevtoolScriptControlMsg>, DevtoolsPageInfo),
SendConsoleMessage(PipelineId, ConsoleMessage),
ServerExitMsg,
HttpRequest(Url, Method, Headers, Option<Vec<u8>>),
HttpResponse(Option<Headers>, RawStatus, Vec<u8>)
NetworkEventMessage(String, NetworkEvent),
}
/// Serialized JS return values
@ -152,6 +151,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 {