mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Implement wire protocol support for DOM inspector.
This commit is contained in:
parent
c31e2f928d
commit
e9c4aa534d
5 changed files with 554 additions and 18 deletions
|
@ -36,6 +36,20 @@ struct ReconfigureReply {
|
|||
from: String
|
||||
}
|
||||
|
||||
#[deriving(Encodable)]
|
||||
struct ListFramesReply {
|
||||
from: String,
|
||||
frames: Vec<FrameMsg>,
|
||||
}
|
||||
|
||||
#[deriving(Encodable)]
|
||||
struct FrameMsg {
|
||||
id: uint,
|
||||
url: String,
|
||||
title: String,
|
||||
parentID: uint,
|
||||
}
|
||||
|
||||
#[deriving(Encodable)]
|
||||
pub struct TabActorMsg {
|
||||
actor: String,
|
||||
|
@ -43,12 +57,15 @@ pub struct TabActorMsg {
|
|||
url: String,
|
||||
outerWindowID: uint,
|
||||
consoleActor: String,
|
||||
inspectorActor: String,
|
||||
}
|
||||
|
||||
pub struct TabActor {
|
||||
pub name: String,
|
||||
pub title: String,
|
||||
pub url: String,
|
||||
pub console: String,
|
||||
pub inspector: String,
|
||||
}
|
||||
|
||||
impl Actor for TabActor {
|
||||
|
@ -90,6 +107,16 @@ impl Actor for TabActor {
|
|||
stream.write_json_packet(&msg);
|
||||
true
|
||||
}
|
||||
|
||||
"listFrames" => {
|
||||
let msg = ListFramesReply {
|
||||
from: self.name(),
|
||||
frames: vec!(),
|
||||
};
|
||||
stream.write_json_packet(&msg);
|
||||
true
|
||||
}
|
||||
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +129,8 @@ impl TabActor {
|
|||
title: self.title.clone(),
|
||||
url: self.url.clone(),
|
||||
outerWindowID: 0, //FIXME: this should probably be the pipeline id
|
||||
consoleActor: "console0".to_string(), //FIXME: this should be the actual actor name
|
||||
consoleActor: self.console.clone(),
|
||||
inspectorActor: self.inspector.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue