aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo/lib.rs
diff options
context:
space:
mode:
authorGregory Terzian <gterzian@users.noreply.github.com>2018-09-11 15:49:47 +0800
committerGregory Terzian <gterzian@users.noreply.github.com>2018-11-26 14:15:33 +0800
commit4eb785cdc0446539bf5e7eb66bf7ad46ba5705dd (patch)
tree3703ffe374141ff2816b1b3adf6c54ec1bdcf722 /components/servo/lib.rs
parent7c65505df3fff47f43062da20088113631ed9ae0 (diff)
downloadservo-4eb785cdc0446539bf5e7eb66bf7ad46ba5705dd.tar.gz
servo-4eb785cdc0446539bf5e7eb66bf7ad46ba5705dd.zip
introduce a background-hang-monitor:
Mac-Os implementation of a thread sampler, Linux and Windows skeleton implementations.
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r--components/servo/lib.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index d44289e6126..93cda15c419 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -20,6 +20,7 @@
#[macro_use]
extern crate log;
+pub use background_hang_monitor;
pub use bluetooth;
pub use bluetooth_traits;
pub use canvas;
@@ -59,6 +60,7 @@ fn webdriver(port: u16, constellation: Sender<ConstellationMsg>) {
#[cfg(not(feature = "webdriver"))]
fn webdriver(_port: u16, _constellation: Sender<ConstellationMsg>) {}
+use background_hang_monitor::HangMonitorRegister;
use bluetooth::BluetoothThreadFactory;
use bluetooth_traits::BluetoothRequest;
use canvas::gl_context::GLContextFactory;
@@ -640,6 +642,12 @@ pub fn run_content_process(token: String) {
create_sandbox();
}
+ let background_hang_monitor_register = HangMonitorRegister::init(
+ unprivileged_content
+ .background_hang_monitor_to_constellation_chan()
+ .clone(),
+ );
+
// send the required channels to the service worker manager
let sw_senders = unprivileged_content.swmanager_senders();
script::init();
@@ -647,7 +655,10 @@ pub fn run_content_process(token: String) {
unprivileged_content.start_all::<script_layout_interface::message::Msg,
layout_thread::LayoutThread,
- script::script_thread::ScriptThread>(true);
+ script::script_thread::ScriptThread>(
+ true,
+ background_hang_monitor_register
+ );
}
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]