mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue