Implement a ProfilerActor struct.

This is sufficient to make the profiler tab show up in Firefox's devtools.
This commit is contained in:
Ms2ger 2015-08-13 15:36:13 +02:00
parent 9fda72d60f
commit c10bf0dcaa
3 changed files with 46 additions and 2 deletions

View file

@ -0,0 +1,34 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use actor::{Actor, ActorRegistry};
use rustc_serialize::json;
use std::net::TcpStream;
pub struct ProfilerActor {
name: String,
}
impl Actor for ProfilerActor {
fn name(&self) -> String {
self.name.clone()
}
fn handle_message(&self,
_registry: &ActorRegistry,
_msg_type: &str,
_msg: &json::Object,
_stream: &mut TcpStream) -> Result<bool, ()> {
Ok(false)
}
}
impl ProfilerActor {
pub fn new(name: String) -> ProfilerActor {
ProfilerActor {
name: name,
}
}
}

View file

@ -62,6 +62,7 @@ pub struct TabActorMsg {
consoleActor: String,
inspectorActor: String,
timelineActor: String,
profilerActor: String,
}
pub struct TabActor {
@ -71,6 +72,7 @@ pub struct TabActor {
pub console: String,
pub inspector: String,
pub timeline: String,
pub profiler: String,
}
impl Actor for TabActor {
@ -147,6 +149,7 @@ impl TabActor {
consoleActor: self.console.clone(),
inspectorActor: self.inspector.clone(),
timelineActor: self.timeline.clone(),
profilerActor: self.profiler.clone(),
}
}
}