mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Implement a ProfilerActor struct.
This is sufficient to make the profiler tab show up in Firefox's devtools.
This commit is contained in:
parent
9fda72d60f
commit
c10bf0dcaa
3 changed files with 46 additions and 2 deletions
34
components/devtools/actors/profiler.rs
Normal file
34
components/devtools/actors/profiler.rs
Normal 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,
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue