mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Properly return an empty list in devtools' listAddons
This commit is contained in:
parent
327f1c1eb8
commit
b409926111
1 changed files with 7 additions and 6 deletions
|
@ -21,12 +21,14 @@ struct ActorTraits {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(RustcEncodable)]
|
#[derive(RustcEncodable)]
|
||||||
struct ErrorReply {
|
struct ListAddonsReply {
|
||||||
from: String,
|
from: String,
|
||||||
error: String,
|
addons: Vec<AddonMsg>,
|
||||||
message: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(RustcEncodable)]
|
||||||
|
enum AddonMsg {}
|
||||||
|
|
||||||
#[derive(RustcEncodable)]
|
#[derive(RustcEncodable)]
|
||||||
struct ListTabsReply {
|
struct ListTabsReply {
|
||||||
from: String,
|
from: String,
|
||||||
|
@ -57,10 +59,9 @@ impl Actor for RootActor {
|
||||||
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
|
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
|
||||||
Ok(match msg_type {
|
Ok(match msg_type {
|
||||||
"listAddons" => {
|
"listAddons" => {
|
||||||
let actor = ErrorReply {
|
let actor = ListAddonsReply {
|
||||||
from: "root".to_owned(),
|
from: "root".to_owned(),
|
||||||
error: "noAddons".to_owned(),
|
addons: vec![],
|
||||||
message: "This root actor has no browser addons.".to_owned(),
|
|
||||||
};
|
};
|
||||||
stream.write_json_packet(&actor);
|
stream.write_json_packet(&actor);
|
||||||
ActorMessageStatus::Processed
|
ActorMessageStatus::Processed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue