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,
}
}
}