mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
parent
87af57cefc
commit
2764ec0f7b
5 changed files with 17 additions and 17 deletions
|
@ -18,7 +18,7 @@ use rustc_serialize::json;
|
||||||
pub trait Actor: Any {
|
pub trait Actor: Any {
|
||||||
fn handle_message(&self,
|
fn handle_message(&self,
|
||||||
registry: &ActorRegistry,
|
registry: &ActorRegistry,
|
||||||
msg_type: &String,
|
msg_type: &str,
|
||||||
msg: &json::Object,
|
msg: &json::Object,
|
||||||
stream: &mut TcpStream) -> Result<bool, ()>;
|
stream: &mut TcpStream) -> Result<bool, ()>;
|
||||||
fn name(&self) -> String;
|
fn name(&self) -> String;
|
||||||
|
|
|
@ -118,10 +118,10 @@ impl Actor for ConsoleActor {
|
||||||
|
|
||||||
fn handle_message(&self,
|
fn handle_message(&self,
|
||||||
_registry: &ActorRegistry,
|
_registry: &ActorRegistry,
|
||||||
msg_type: &String,
|
msg_type: &str,
|
||||||
msg: &json::Object,
|
msg: &json::Object,
|
||||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||||
Ok(match &**msg_type {
|
Ok(match msg_type {
|
||||||
"getCachedMessages" => {
|
"getCachedMessages" => {
|
||||||
let types = msg.get(&"messageTypes".to_string()).unwrap().as_array().unwrap();
|
let types = msg.get(&"messageTypes".to_string()).unwrap().as_array().unwrap();
|
||||||
let /*mut*/ messages = vec!();
|
let /*mut*/ messages = vec!();
|
||||||
|
|
|
@ -66,10 +66,10 @@ impl Actor for HighlighterActor {
|
||||||
|
|
||||||
fn handle_message(&self,
|
fn handle_message(&self,
|
||||||
_registry: &ActorRegistry,
|
_registry: &ActorRegistry,
|
||||||
msg_type: &String,
|
msg_type: &str,
|
||||||
_msg: &json::Object,
|
_msg: &json::Object,
|
||||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||||
Ok(match &**msg_type {
|
Ok(match msg_type {
|
||||||
"showBoxModel" => {
|
"showBoxModel" => {
|
||||||
let msg = ShowBoxModelReply {
|
let msg = ShowBoxModelReply {
|
||||||
from: self.name(),
|
from: self.name(),
|
||||||
|
@ -103,10 +103,10 @@ impl Actor for NodeActor {
|
||||||
|
|
||||||
fn handle_message(&self,
|
fn handle_message(&self,
|
||||||
registry: &ActorRegistry,
|
registry: &ActorRegistry,
|
||||||
msg_type: &String,
|
msg_type: &str,
|
||||||
msg: &json::Object,
|
msg: &json::Object,
|
||||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||||
Ok(match &**msg_type {
|
Ok(match msg_type {
|
||||||
"modifyAttributes" => {
|
"modifyAttributes" => {
|
||||||
let target = msg.get(&"to".to_string()).unwrap().as_string().unwrap();
|
let target = msg.get(&"to".to_string()).unwrap().as_string().unwrap();
|
||||||
let mods = msg.get(&"modifications".to_string()).unwrap().as_array().unwrap();
|
let mods = msg.get(&"modifications".to_string()).unwrap().as_array().unwrap();
|
||||||
|
@ -277,10 +277,10 @@ impl Actor for WalkerActor {
|
||||||
|
|
||||||
fn handle_message(&self,
|
fn handle_message(&self,
|
||||||
registry: &ActorRegistry,
|
registry: &ActorRegistry,
|
||||||
msg_type: &String,
|
msg_type: &str,
|
||||||
msg: &json::Object,
|
msg: &json::Object,
|
||||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||||
Ok(match &**msg_type {
|
Ok(match msg_type {
|
||||||
"querySelector" => {
|
"querySelector" => {
|
||||||
let msg = QuerySelectorReply {
|
let msg = QuerySelectorReply {
|
||||||
from: self.name(),
|
from: self.name(),
|
||||||
|
@ -423,10 +423,10 @@ impl Actor for PageStyleActor {
|
||||||
|
|
||||||
fn handle_message(&self,
|
fn handle_message(&self,
|
||||||
registry: &ActorRegistry,
|
registry: &ActorRegistry,
|
||||||
msg_type: &String,
|
msg_type: &str,
|
||||||
msg: &json::Object,
|
msg: &json::Object,
|
||||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||||
Ok(match &**msg_type {
|
Ok(match msg_type {
|
||||||
"getApplied" => {
|
"getApplied" => {
|
||||||
//TODO: query script for relevant applied styles to node (msg.node)
|
//TODO: query script for relevant applied styles to node (msg.node)
|
||||||
let msg = GetAppliedReply {
|
let msg = GetAppliedReply {
|
||||||
|
@ -495,10 +495,10 @@ impl Actor for InspectorActor {
|
||||||
|
|
||||||
fn handle_message(&self,
|
fn handle_message(&self,
|
||||||
registry: &ActorRegistry,
|
registry: &ActorRegistry,
|
||||||
msg_type: &String,
|
msg_type: &str,
|
||||||
_msg: &json::Object,
|
_msg: &json::Object,
|
||||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||||
Ok(match &**msg_type {
|
Ok(match msg_type {
|
||||||
"getWalker" => {
|
"getWalker" => {
|
||||||
if self.walker.borrow().is_none() {
|
if self.walker.borrow().is_none() {
|
||||||
let walker = WalkerActor {
|
let walker = WalkerActor {
|
||||||
|
|
|
@ -52,10 +52,10 @@ impl Actor for RootActor {
|
||||||
|
|
||||||
fn handle_message(&self,
|
fn handle_message(&self,
|
||||||
registry: &ActorRegistry,
|
registry: &ActorRegistry,
|
||||||
msg_type: &String,
|
msg_type: &str,
|
||||||
_msg: &json::Object,
|
_msg: &json::Object,
|
||||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||||
Ok(match &**msg_type {
|
Ok(match msg_type {
|
||||||
"listAddons" => {
|
"listAddons" => {
|
||||||
let actor = ErrorReply {
|
let actor = ErrorReply {
|
||||||
from: "root".to_string(),
|
from: "root".to_string(),
|
||||||
|
|
|
@ -77,10 +77,10 @@ impl Actor for TabActor {
|
||||||
|
|
||||||
fn handle_message(&self,
|
fn handle_message(&self,
|
||||||
registry: &ActorRegistry,
|
registry: &ActorRegistry,
|
||||||
msg_type: &String,
|
msg_type: &str,
|
||||||
_msg: &json::Object,
|
_msg: &json::Object,
|
||||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||||
Ok(match &**msg_type {
|
Ok(match msg_type {
|
||||||
"reconfigure" => {
|
"reconfigure" => {
|
||||||
stream.write_json_packet(&ReconfigureReply { from: self.name() });
|
stream.write_json_packet(&ReconfigureReply { from: self.name() });
|
||||||
true
|
true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue