mirror of
https://github.com/servo/servo.git
synced 2025-06-20 23:28:59 +01:00
deactive profiler when not in use; use newtype structs for task chans
This commit is contained in:
parent
17864cb25d
commit
c804db0f93
7 changed files with 55 additions and 92 deletions
|
@ -83,20 +83,11 @@ pub struct NewLayoutInfo {
|
|||
|
||||
/// Encapsulates external communication with the script task.
|
||||
#[deriving(Clone)]
|
||||
pub struct ScriptChan {
|
||||
/// The channel used to send messages to the script task.
|
||||
chan: SharedChan<ScriptMsg>,
|
||||
}
|
||||
|
||||
pub struct ScriptChan(SharedChan<ScriptMsg>);
|
||||
impl ScriptChan {
|
||||
/// Creates a new script chan.
|
||||
pub fn new(chan: Chan<ScriptMsg>) -> ScriptChan {
|
||||
ScriptChan {
|
||||
chan: SharedChan::new(chan)
|
||||
}
|
||||
}
|
||||
pub fn send(&self, msg: ScriptMsg) {
|
||||
self.chan.send(msg);
|
||||
ScriptChan(SharedChan::new(chan))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue