mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Wire up the JS engine's memory reporting.
SpiderMonkey provides an extremely fine-grained breakdown of memory usage, but for Servo we aggregate the measurements into a small number of coarse buckets, which seems appropriate for the current level of detail provided by Servo's memory profiler. Sample output: ``` | 10.99 MiB -- pages | 7.75 MiB -- url(http://html5demos.com/worker) | 4.63 MiB -- js | 2.00 MiB -- gc-heap | 0.94 MiB -- decommitted | 0.92 MiB -- used | 0.09 MiB -- unused | 0.05 MiB -- admin | 1.44 MiB -- malloc-heap | 1.19 MiB -- non-heap | [...] | 3.24 MiB -- url(http://html5demos.com/js/worker-cruncher.js) | 3.24 MiB -- js | 1.17 MiB -- malloc-heap | 1.06 MiB -- non-heap | 1.00 MiB -- gc-heap | 0.69 MiB -- used | 0.19 MiB -- decommitted | 0.09 MiB -- unused | 0.03 MiB -- admin ``` Most of the changes are plumbing to get the script and worker tasks communicating with the memory profiler task.
This commit is contained in:
parent
ef9715203e
commit
7429b90e02
15 changed files with 177 additions and 21 deletions
|
@ -318,6 +318,7 @@ impl PipelineContent {
|
||||||
self.resource_task,
|
self.resource_task,
|
||||||
self.storage_task.clone(),
|
self.storage_task.clone(),
|
||||||
self.image_cache_task.clone(),
|
self.image_cache_task.clone(),
|
||||||
|
self.mem_profiler_chan.clone(),
|
||||||
self.devtools_chan,
|
self.devtools_chan,
|
||||||
self.window_size,
|
self.window_size,
|
||||||
self.load_data.clone());
|
self.load_data.clone());
|
||||||
|
|
|
@ -19,6 +19,7 @@ use script_task::{ScriptChan, ScriptPort, ScriptMsg, ScriptTask};
|
||||||
|
|
||||||
use msg::constellation_msg::{PipelineId, WorkerId};
|
use msg::constellation_msg::{PipelineId, WorkerId};
|
||||||
use net_traits::ResourceTask;
|
use net_traits::ResourceTask;
|
||||||
|
use profile_traits::mem;
|
||||||
|
|
||||||
use js::{JSCLASS_IS_GLOBAL, JSCLASS_IS_DOMJSCLASS};
|
use js::{JSCLASS_IS_GLOBAL, JSCLASS_IS_DOMJSCLASS};
|
||||||
use js::jsapi::{GetGlobalForObjectCrossCompartment};
|
use js::jsapi::{GetGlobalForObjectCrossCompartment};
|
||||||
|
@ -82,7 +83,15 @@ impl<'a> GlobalRef<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get `DevtoolsControlChan` to send messages to Devtools
|
/// Get a `mem::ProfilerChan` to send messages to the memory profiler task.
|
||||||
|
pub fn mem_profiler_chan(&self) -> mem::ProfilerChan {
|
||||||
|
match *self {
|
||||||
|
GlobalRef::Window(window) => window.mem_profiler_chan(),
|
||||||
|
GlobalRef::Worker(worker) => worker.mem_profiler_chan(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get a `DevtoolsControlChan` to send messages to Devtools
|
||||||
/// task when available.
|
/// task when available.
|
||||||
pub fn devtools_chan(&self) -> Option<DevtoolsControlChan> {
|
pub fn devtools_chan(&self) -> Option<DevtoolsControlChan> {
|
||||||
match *self {
|
match *self {
|
||||||
|
|
|
@ -60,6 +60,7 @@ use smallvec::SmallVec1;
|
||||||
use msg::compositor_msg::ScriptListener;
|
use msg::compositor_msg::ScriptListener;
|
||||||
use msg::constellation_msg::ConstellationChan;
|
use msg::constellation_msg::ConstellationChan;
|
||||||
use net_traits::image::base::Image;
|
use net_traits::image::base::Image;
|
||||||
|
use profile_traits::mem::ProfilerChan;
|
||||||
use util::str::{LengthOrPercentageOrAuto};
|
use util::str::{LengthOrPercentageOrAuto};
|
||||||
use std::cell::{Cell, UnsafeCell, RefCell};
|
use std::cell::{Cell, UnsafeCell, RefCell};
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
@ -299,6 +300,7 @@ no_jsmanaged_fields!(CanvasGradientStop, LinearGradientStyle, RadialGradientStyl
|
||||||
no_jsmanaged_fields!(LineCapStyle, LineJoinStyle, CompositionOrBlending);
|
no_jsmanaged_fields!(LineCapStyle, LineJoinStyle, CompositionOrBlending);
|
||||||
no_jsmanaged_fields!(RepetitionStyle);
|
no_jsmanaged_fields!(RepetitionStyle);
|
||||||
no_jsmanaged_fields!(WebGLError);
|
no_jsmanaged_fields!(WebGLError);
|
||||||
|
no_jsmanaged_fields!(ProfilerChan);
|
||||||
|
|
||||||
impl JSTraceable for Box<ScriptChan+Send> {
|
impl JSTraceable for Box<ScriptChan+Send> {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -29,6 +29,7 @@ use msg::constellation_msg::PipelineId;
|
||||||
use devtools_traits::DevtoolsControlChan;
|
use devtools_traits::DevtoolsControlChan;
|
||||||
|
|
||||||
use net_traits::{load_whole_resource, ResourceTask};
|
use net_traits::{load_whole_resource, ResourceTask};
|
||||||
|
use profile_traits::mem::{self, Reporter, ReportsChan};
|
||||||
use util::task::spawn_named;
|
use util::task::spawn_named;
|
||||||
use util::task_state;
|
use util::task_state;
|
||||||
use util::task_state::{SCRIPT, IN_WORKER};
|
use util::task_state::{SCRIPT, IN_WORKER};
|
||||||
|
@ -39,6 +40,7 @@ use js::jsval::UndefinedValue;
|
||||||
use js::rust::Runtime;
|
use js::rust::Runtime;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
use rand::random;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::mpsc::{Sender, Receiver, channel};
|
use std::sync::mpsc::{Sender, Receiver, channel};
|
||||||
|
|
||||||
|
@ -64,6 +66,13 @@ impl ScriptChan for SendableWorkerScriptChan {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Reporter for SendableWorkerScriptChan {
|
||||||
|
// Just injects an appropriate event into the worker task's queue.
|
||||||
|
fn collect_reports(&self, reports_chan: ReportsChan) -> bool {
|
||||||
|
self.send(ScriptMsg::CollectReports(reports_chan)).is_ok()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Set the `worker` field of a related DedicatedWorkerGlobalScope object to a particular
|
/// Set the `worker` field of a related DedicatedWorkerGlobalScope object to a particular
|
||||||
/// value for the duration of this object's lifetime. This ensures that the related Worker
|
/// value for the duration of this object's lifetime. This ensures that the related Worker
|
||||||
/// object only lives as long as necessary (ie. while events are being executed), while
|
/// object only lives as long as necessary (ie. while events are being executed), while
|
||||||
|
@ -105,6 +114,7 @@ pub struct DedicatedWorkerGlobalScope {
|
||||||
impl DedicatedWorkerGlobalScope {
|
impl DedicatedWorkerGlobalScope {
|
||||||
fn new_inherited(worker_url: Url,
|
fn new_inherited(worker_url: Url,
|
||||||
id: PipelineId,
|
id: PipelineId,
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
devtools_chan: Option<DevtoolsControlChan>,
|
devtools_chan: Option<DevtoolsControlChan>,
|
||||||
runtime: Rc<Runtime>,
|
runtime: Rc<Runtime>,
|
||||||
resource_task: ResourceTask,
|
resource_task: ResourceTask,
|
||||||
|
@ -115,7 +125,7 @@ impl DedicatedWorkerGlobalScope {
|
||||||
DedicatedWorkerGlobalScope {
|
DedicatedWorkerGlobalScope {
|
||||||
workerglobalscope: WorkerGlobalScope::new_inherited(
|
workerglobalscope: WorkerGlobalScope::new_inherited(
|
||||||
WorkerGlobalScopeTypeId::DedicatedGlobalScope, worker_url,
|
WorkerGlobalScopeTypeId::DedicatedGlobalScope, worker_url,
|
||||||
runtime, resource_task, devtools_chan),
|
runtime, resource_task, mem_profiler_chan, devtools_chan),
|
||||||
id: id,
|
id: id,
|
||||||
receiver: receiver,
|
receiver: receiver,
|
||||||
own_sender: own_sender,
|
own_sender: own_sender,
|
||||||
|
@ -126,6 +136,7 @@ impl DedicatedWorkerGlobalScope {
|
||||||
|
|
||||||
pub fn new(worker_url: Url,
|
pub fn new(worker_url: Url,
|
||||||
id: PipelineId,
|
id: PipelineId,
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
devtools_chan: Option<DevtoolsControlChan>,
|
devtools_chan: Option<DevtoolsControlChan>,
|
||||||
runtime: Rc<Runtime>,
|
runtime: Rc<Runtime>,
|
||||||
resource_task: ResourceTask,
|
resource_task: ResourceTask,
|
||||||
|
@ -134,7 +145,7 @@ impl DedicatedWorkerGlobalScope {
|
||||||
receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>)
|
receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>)
|
||||||
-> Root<DedicatedWorkerGlobalScope> {
|
-> Root<DedicatedWorkerGlobalScope> {
|
||||||
let scope = box DedicatedWorkerGlobalScope::new_inherited(
|
let scope = box DedicatedWorkerGlobalScope::new_inherited(
|
||||||
worker_url, id, devtools_chan, runtime.clone(), resource_task,
|
worker_url, id, mem_profiler_chan, devtools_chan, runtime.clone(), resource_task,
|
||||||
parent_sender, own_sender, receiver);
|
parent_sender, own_sender, receiver);
|
||||||
DedicatedWorkerGlobalScopeBinding::Wrap(runtime.cx(), scope)
|
DedicatedWorkerGlobalScopeBinding::Wrap(runtime.cx(), scope)
|
||||||
}
|
}
|
||||||
|
@ -143,6 +154,7 @@ impl DedicatedWorkerGlobalScope {
|
||||||
impl DedicatedWorkerGlobalScope {
|
impl DedicatedWorkerGlobalScope {
|
||||||
pub fn run_worker_scope(worker_url: Url,
|
pub fn run_worker_scope(worker_url: Url,
|
||||||
id: PipelineId,
|
id: PipelineId,
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
devtools_chan: Option<DevtoolsControlChan>,
|
devtools_chan: Option<DevtoolsControlChan>,
|
||||||
worker: TrustedWorkerAddress,
|
worker: TrustedWorkerAddress,
|
||||||
resource_task: ResourceTask,
|
resource_task: ResourceTask,
|
||||||
|
@ -171,8 +183,12 @@ impl DedicatedWorkerGlobalScope {
|
||||||
let runtime = Rc::new(ScriptTask::new_rt_and_cx());
|
let runtime = Rc::new(ScriptTask::new_rt_and_cx());
|
||||||
let serialized_url = url.serialize();
|
let serialized_url = url.serialize();
|
||||||
let global = DedicatedWorkerGlobalScope::new(
|
let global = DedicatedWorkerGlobalScope::new(
|
||||||
url, id, devtools_chan, runtime.clone(), resource_task,
|
url, id, mem_profiler_chan.clone(), devtools_chan, runtime.clone(), resource_task,
|
||||||
parent_sender, own_sender, receiver);
|
parent_sender, own_sender, receiver);
|
||||||
|
// FIXME(njn): workers currently don't have a unique ID suitable for using in reporter
|
||||||
|
// registration (#6631), so we instead use a random number and cross our fingers.
|
||||||
|
let reporter_name = format!("worker-reporter-{}", random::<u64>());
|
||||||
|
println!("reporter_name = {}", reporter_name);
|
||||||
|
|
||||||
{
|
{
|
||||||
let _ar = AutoWorkerReset::new(global.r(), worker);
|
let _ar = AutoWorkerReset::new(global.r(), worker);
|
||||||
|
@ -188,6 +204,12 @@ impl DedicatedWorkerGlobalScope {
|
||||||
report_pending_exception(runtime.cx(), global.r().reflector().get_jsobject().get());
|
report_pending_exception(runtime.cx(), global.r().reflector().get_jsobject().get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Register this task as a memory reporter. This needs to be done within the
|
||||||
|
// scope of `_ar` otherwise script_chan_as_reporter() will panic.
|
||||||
|
let reporter = global.script_chan_as_reporter();
|
||||||
|
let msg = mem::ProfilerMsg::RegisterReporter(reporter_name.clone(), reporter);
|
||||||
|
mem_profiler_chan.send(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
@ -199,12 +221,17 @@ impl DedicatedWorkerGlobalScope {
|
||||||
Err(_) => break,
|
Err(_) => break,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unregister this task as a memory reporter.
|
||||||
|
let msg = mem::ProfilerMsg::UnregisterReporter(reporter_name);
|
||||||
|
mem_profiler_chan.send(msg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait DedicatedWorkerGlobalScopeHelpers {
|
pub trait DedicatedWorkerGlobalScopeHelpers {
|
||||||
fn script_chan(self) -> Box<ScriptChan+Send>;
|
fn script_chan(self) -> Box<ScriptChan+Send>;
|
||||||
|
fn script_chan_as_reporter(self) -> Box<Reporter+Send>;
|
||||||
fn pipeline(self) -> PipelineId;
|
fn pipeline(self) -> PipelineId;
|
||||||
fn new_script_pair(self) -> (Box<ScriptChan+Send>, Box<ScriptPort+Send>);
|
fn new_script_pair(self) -> (Box<ScriptChan+Send>, Box<ScriptPort+Send>);
|
||||||
fn process_event(self, msg: ScriptMsg);
|
fn process_event(self, msg: ScriptMsg);
|
||||||
|
@ -218,6 +245,14 @@ impl<'a> DedicatedWorkerGlobalScopeHelpers for &'a DedicatedWorkerGlobalScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn script_chan_as_reporter(self) -> Box<Reporter+Send> {
|
||||||
|
box SendableWorkerScriptChan {
|
||||||
|
sender: self.own_sender.clone(),
|
||||||
|
worker: self.worker.borrow().as_ref().unwrap().clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fn pipeline(self) -> PipelineId {
|
fn pipeline(self) -> PipelineId {
|
||||||
self.id
|
self.id
|
||||||
}
|
}
|
||||||
|
@ -263,6 +298,13 @@ impl<'a> PrivateDedicatedWorkerGlobalScopeHelpers for &'a DedicatedWorkerGlobalS
|
||||||
let scope = WorkerGlobalScopeCast::from_ref(self);
|
let scope = WorkerGlobalScopeCast::from_ref(self);
|
||||||
scope.handle_fire_timer(timer_id);
|
scope.handle_fire_timer(timer_id);
|
||||||
}
|
}
|
||||||
|
ScriptMsg::CollectReports(reports_chan) => {
|
||||||
|
let scope = WorkerGlobalScopeCast::from_ref(self);
|
||||||
|
let cx = scope.get_cx();
|
||||||
|
let path_seg = format!("url({})", scope.get_url());
|
||||||
|
let reports = ScriptTask::get_reports(cx, path_seg);
|
||||||
|
reports_chan.send(reports);
|
||||||
|
}
|
||||||
_ => panic!("Unexpected message"),
|
_ => panic!("Unexpected message"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
|
||||||
use net_traits::ResourceTask;
|
use net_traits::ResourceTask;
|
||||||
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask};
|
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask};
|
||||||
use net_traits::storage_task::{StorageTask, StorageType};
|
use net_traits::storage_task::{StorageTask, StorageType};
|
||||||
|
use profile_traits::mem;
|
||||||
use util::geometry::{self, Au, MAX_RECT};
|
use util::geometry::{self, Au, MAX_RECT};
|
||||||
use util::opts;
|
use util::opts;
|
||||||
use util::str::{DOMString,HTML_SPACE_CHARACTERS};
|
use util::str::{DOMString,HTML_SPACE_CHARACTERS};
|
||||||
|
@ -64,7 +65,7 @@ use std::cell::{Cell, Ref, RefMut, RefCell};
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
use std::mem;
|
use std::mem as std_mem;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::mpsc::{channel, Receiver, Sender};
|
use std::sync::mpsc::{channel, Receiver, Sender};
|
||||||
use std::sync::mpsc::TryRecvError::{Empty, Disconnected};
|
use std::sync::mpsc::TryRecvError::{Empty, Disconnected};
|
||||||
|
@ -118,6 +119,9 @@ pub struct Window {
|
||||||
|
|
||||||
next_worker_id: Cell<WorkerId>,
|
next_worker_id: Cell<WorkerId>,
|
||||||
|
|
||||||
|
/// For sending messages to the memory profiler.
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
|
|
||||||
/// For providing instructions to an optional devtools server.
|
/// For providing instructions to an optional devtools server.
|
||||||
devtools_chan: Option<DevtoolsControlChan>,
|
devtools_chan: Option<DevtoolsControlChan>,
|
||||||
/// For sending timeline markers. Will be ignored if
|
/// For sending timeline markers. Will be ignored if
|
||||||
|
@ -538,6 +542,7 @@ pub trait WindowHelpers {
|
||||||
fn window_size(self) -> Option<WindowSizeData>;
|
fn window_size(self) -> Option<WindowSizeData>;
|
||||||
fn get_url(self) -> Url;
|
fn get_url(self) -> Url;
|
||||||
fn resource_task(self) -> ResourceTask;
|
fn resource_task(self) -> ResourceTask;
|
||||||
|
fn mem_profiler_chan(self) -> mem::ProfilerChan;
|
||||||
fn devtools_chan(self) -> Option<DevtoolsControlChan>;
|
fn devtools_chan(self) -> Option<DevtoolsControlChan>;
|
||||||
fn layout_chan(self) -> LayoutChan;
|
fn layout_chan(self) -> LayoutChan;
|
||||||
fn constellation_chan(self) -> ConstellationChan;
|
fn constellation_chan(self) -> ConstellationChan;
|
||||||
|
@ -721,7 +726,7 @@ impl<'a> WindowHelpers for &'a Window {
|
||||||
/// layout task has finished any pending request messages.
|
/// layout task has finished any pending request messages.
|
||||||
fn join_layout(self) {
|
fn join_layout(self) {
|
||||||
let mut layout_join_port = self.layout_join_port.borrow_mut();
|
let mut layout_join_port = self.layout_join_port.borrow_mut();
|
||||||
if let Some(join_port) = mem::replace(&mut *layout_join_port, None) {
|
if let Some(join_port) = std_mem::replace(&mut *layout_join_port, None) {
|
||||||
match join_port.try_recv() {
|
match join_port.try_recv() {
|
||||||
Err(Empty) => {
|
Err(Empty) => {
|
||||||
info!("script: waiting on layout");
|
info!("script: waiting on layout");
|
||||||
|
@ -823,6 +828,10 @@ impl<'a> WindowHelpers for &'a Window {
|
||||||
self.resource_task.clone()
|
self.resource_task.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn mem_profiler_chan(self) -> mem::ProfilerChan {
|
||||||
|
self.mem_profiler_chan.clone()
|
||||||
|
}
|
||||||
|
|
||||||
fn devtools_chan(self) -> Option<DevtoolsControlChan> {
|
fn devtools_chan(self) -> Option<DevtoolsControlChan> {
|
||||||
self.devtools_chan.clone()
|
self.devtools_chan.clone()
|
||||||
}
|
}
|
||||||
|
@ -968,6 +977,7 @@ impl Window {
|
||||||
image_cache_task: ImageCacheTask,
|
image_cache_task: ImageCacheTask,
|
||||||
resource_task: ResourceTask,
|
resource_task: ResourceTask,
|
||||||
storage_task: StorageTask,
|
storage_task: StorageTask,
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
devtools_chan: Option<DevtoolsControlChan>,
|
devtools_chan: Option<DevtoolsControlChan>,
|
||||||
constellation_chan: ConstellationChan,
|
constellation_chan: ConstellationChan,
|
||||||
layout_chan: LayoutChan,
|
layout_chan: LayoutChan,
|
||||||
|
@ -993,6 +1003,7 @@ impl Window {
|
||||||
page: page,
|
page: page,
|
||||||
navigator: Default::default(),
|
navigator: Default::default(),
|
||||||
image_cache_task: image_cache_task,
|
image_cache_task: image_cache_task,
|
||||||
|
mem_profiler_chan: mem_profiler_chan,
|
||||||
devtools_chan: devtools_chan,
|
devtools_chan: devtools_chan,
|
||||||
browser_context: DOMRefCell::new(None),
|
browser_context: DOMRefCell::new(None),
|
||||||
performance: Default::default(),
|
performance: Default::default(),
|
||||||
|
|
|
@ -90,8 +90,8 @@ impl Worker {
|
||||||
}
|
}
|
||||||
|
|
||||||
DedicatedWorkerGlobalScope::run_worker_scope(
|
DedicatedWorkerGlobalScope::run_worker_scope(
|
||||||
worker_url, global.pipeline(), global.devtools_chan(), worker_ref, resource_task, global.script_chan(),
|
worker_url, global.pipeline(), global.mem_profiler_chan(), global.devtools_chan(),
|
||||||
sender, receiver);
|
worker_ref, resource_task, global.script_chan(), sender, receiver);
|
||||||
|
|
||||||
Ok(worker)
|
Ok(worker)
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ use timers::{IsInterval, TimerId, TimerManager, TimerCallback};
|
||||||
use devtools_traits::DevtoolsControlChan;
|
use devtools_traits::DevtoolsControlChan;
|
||||||
|
|
||||||
use msg::constellation_msg::{PipelineId, WorkerId};
|
use msg::constellation_msg::{PipelineId, WorkerId};
|
||||||
|
use profile_traits::mem;
|
||||||
use net_traits::{load_whole_resource, ResourceTask};
|
use net_traits::{load_whole_resource, ResourceTask};
|
||||||
use util::str::DOMString;
|
use util::str::DOMString;
|
||||||
|
|
||||||
|
@ -52,6 +53,7 @@ pub struct WorkerGlobalScope {
|
||||||
console: MutNullableHeap<JS<Console>>,
|
console: MutNullableHeap<JS<Console>>,
|
||||||
crypto: MutNullableHeap<JS<Crypto>>,
|
crypto: MutNullableHeap<JS<Crypto>>,
|
||||||
timers: TimerManager,
|
timers: TimerManager,
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
devtools_chan: Option<DevtoolsControlChan>,
|
devtools_chan: Option<DevtoolsControlChan>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +62,7 @@ impl WorkerGlobalScope {
|
||||||
worker_url: Url,
|
worker_url: Url,
|
||||||
runtime: Rc<Runtime>,
|
runtime: Rc<Runtime>,
|
||||||
resource_task: ResourceTask,
|
resource_task: ResourceTask,
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
devtools_chan: Option<DevtoolsControlChan>) -> WorkerGlobalScope {
|
devtools_chan: Option<DevtoolsControlChan>) -> WorkerGlobalScope {
|
||||||
WorkerGlobalScope {
|
WorkerGlobalScope {
|
||||||
eventtarget: EventTarget::new_inherited(EventTargetTypeId::WorkerGlobalScope(type_id)),
|
eventtarget: EventTarget::new_inherited(EventTargetTypeId::WorkerGlobalScope(type_id)),
|
||||||
|
@ -72,10 +75,15 @@ impl WorkerGlobalScope {
|
||||||
console: Default::default(),
|
console: Default::default(),
|
||||||
crypto: Default::default(),
|
crypto: Default::default(),
|
||||||
timers: TimerManager::new(),
|
timers: TimerManager::new(),
|
||||||
|
mem_profiler_chan: mem_profiler_chan,
|
||||||
devtools_chan: devtools_chan,
|
devtools_chan: devtools_chan,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn mem_profiler_chan(&self) -> mem::ProfilerChan {
|
||||||
|
self.mem_profiler_chan.clone()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn devtools_chan(&self) -> Option<DevtoolsControlChan> {
|
pub fn devtools_chan(&self) -> Option<DevtoolsControlChan> {
|
||||||
self.devtools_chan.clone()
|
self.devtools_chan.clone()
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ extern crate time;
|
||||||
extern crate canvas;
|
extern crate canvas;
|
||||||
extern crate canvas_traits;
|
extern crate canvas_traits;
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
|
#[macro_use]
|
||||||
extern crate profile_traits;
|
extern crate profile_traits;
|
||||||
extern crate script_traits;
|
extern crate script_traits;
|
||||||
extern crate selectors;
|
extern crate selectors;
|
||||||
|
|
|
@ -70,6 +70,7 @@ use net_traits::{ResourceTask, LoadConsumer, ControlMsg, Metadata};
|
||||||
use net_traits::LoadData as NetLoadData;
|
use net_traits::LoadData as NetLoadData;
|
||||||
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageCacheResult};
|
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageCacheResult};
|
||||||
use net_traits::storage_task::StorageTask;
|
use net_traits::storage_task::StorageTask;
|
||||||
|
use profile_traits::mem::{self, Report, Reporter, ReportsChan};
|
||||||
use string_cache::Atom;
|
use string_cache::Atom;
|
||||||
use util::str::DOMString;
|
use util::str::DOMString;
|
||||||
use util::task::spawn_named_with_send_on_failure;
|
use util::task::spawn_named_with_send_on_failure;
|
||||||
|
@ -78,9 +79,10 @@ use util::task_state;
|
||||||
use euclid::Rect;
|
use euclid::Rect;
|
||||||
use euclid::point::Point2D;
|
use euclid::point::Point2D;
|
||||||
use hyper::header::{LastModified, Headers};
|
use hyper::header::{LastModified, Headers};
|
||||||
|
use js::glue::CollectServoSizes;
|
||||||
use js::jsapi::{JS_SetWrapObjectCallbacks, JS_AddExtraGCRootsTracer, DisableIncrementalGC};
|
use js::jsapi::{JS_SetWrapObjectCallbacks, JS_AddExtraGCRootsTracer, DisableIncrementalGC};
|
||||||
use js::jsapi::{JSContext, JSRuntime, JSTracer};
|
use js::jsapi::{JSContext, JSRuntime, JSTracer};
|
||||||
use js::jsapi::{JS_SetGCCallback, JSGCStatus, JSAutoRequest, SetDOMCallbacks};
|
use js::jsapi::{JS_GetRuntime, JS_SetGCCallback, JSGCStatus, JSAutoRequest, SetDOMCallbacks};
|
||||||
use js::jsapi::{SetDOMProxyInformation, DOMProxyShadowsResult, HandleObject, HandleId, RootedValue};
|
use js::jsapi::{SetDOMProxyInformation, DOMProxyShadowsResult, HandleObject, HandleId, RootedValue};
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
use js::rust::Runtime;
|
use js::rust::Runtime;
|
||||||
|
@ -91,7 +93,7 @@ use std::any::Any;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::cell::{Cell, RefCell};
|
use std::cell::{Cell, RefCell};
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::mem;
|
use std::mem as std_mem;
|
||||||
use std::option::Option;
|
use std::option::Option;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
@ -196,6 +198,9 @@ pub enum ScriptMsg {
|
||||||
RefcountCleanup(TrustedReference),
|
RefcountCleanup(TrustedReference),
|
||||||
/// Notify a document that all pending loads are complete.
|
/// Notify a document that all pending loads are complete.
|
||||||
DocumentLoadsComplete(PipelineId),
|
DocumentLoadsComplete(PipelineId),
|
||||||
|
/// Requests that the script task measure its memory usage. The results are sent back via the
|
||||||
|
/// supplied channel.
|
||||||
|
CollectReports(ReportsChan),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A cloneable interface for communicating with an event loop.
|
/// A cloneable interface for communicating with an event loop.
|
||||||
|
@ -247,6 +252,18 @@ impl NonWorkerScriptChan {
|
||||||
let (chan, port) = channel();
|
let (chan, port) = channel();
|
||||||
(port, box NonWorkerScriptChan(chan))
|
(port, box NonWorkerScriptChan(chan))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn clone_as_reporter(&self) -> Box<Reporter+Send> {
|
||||||
|
let NonWorkerScriptChan(ref chan) = *self;
|
||||||
|
box NonWorkerScriptChan((*chan).clone())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Reporter for NonWorkerScriptChan {
|
||||||
|
// Just injects an appropriate event into the script task's queue.
|
||||||
|
fn collect_reports(&self, reports_chan: ReportsChan) -> bool {
|
||||||
|
self.send(ScriptMsg::CollectReports(reports_chan)).is_ok()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct StackRootTLS;
|
pub struct StackRootTLS;
|
||||||
|
@ -307,6 +324,9 @@ pub struct ScriptTask {
|
||||||
/// The channel on which the image cache can send messages to ourself.
|
/// The channel on which the image cache can send messages to ourself.
|
||||||
image_cache_channel: ImageCacheChan,
|
image_cache_channel: ImageCacheChan,
|
||||||
|
|
||||||
|
/// For providing contact with the memory profiler.
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
|
|
||||||
/// For providing instructions to an optional devtools server.
|
/// For providing instructions to an optional devtools server.
|
||||||
devtools_chan: Option<DevtoolsControlChan>,
|
devtools_chan: Option<DevtoolsControlChan>,
|
||||||
/// For receiving commands from an optional devtools server. Will be ignored if
|
/// For receiving commands from an optional devtools server. Will be ignored if
|
||||||
|
@ -387,6 +407,7 @@ impl ScriptTaskFactory for ScriptTask {
|
||||||
resource_task: ResourceTask,
|
resource_task: ResourceTask,
|
||||||
storage_task: StorageTask,
|
storage_task: StorageTask,
|
||||||
image_cache_task: ImageCacheTask,
|
image_cache_task: ImageCacheTask,
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
devtools_chan: Option<DevtoolsControlChan>,
|
devtools_chan: Option<DevtoolsControlChan>,
|
||||||
window_size: Option<WindowSizeData>,
|
window_size: Option<WindowSizeData>,
|
||||||
load_data: LoadData) {
|
load_data: LoadData) {
|
||||||
|
@ -396,15 +417,18 @@ impl ScriptTaskFactory for ScriptTask {
|
||||||
spawn_named_with_send_on_failure(format!("ScriptTask {:?}", id), task_state::SCRIPT, move || {
|
spawn_named_with_send_on_failure(format!("ScriptTask {:?}", id), task_state::SCRIPT, move || {
|
||||||
let roots = RootCollection::new();
|
let roots = RootCollection::new();
|
||||||
let _stack_roots_tls = StackRootTLS::new(&roots);
|
let _stack_roots_tls = StackRootTLS::new(&roots);
|
||||||
|
let chan = NonWorkerScriptChan(script_chan);
|
||||||
|
let reporter = chan.clone_as_reporter();
|
||||||
let script_task = ScriptTask::new(compositor,
|
let script_task = ScriptTask::new(compositor,
|
||||||
script_port,
|
script_port,
|
||||||
NonWorkerScriptChan(script_chan),
|
chan,
|
||||||
control_chan,
|
control_chan,
|
||||||
control_port,
|
control_port,
|
||||||
constellation_chan,
|
constellation_chan,
|
||||||
resource_task,
|
resource_task,
|
||||||
storage_task,
|
storage_task,
|
||||||
image_cache_task,
|
image_cache_task,
|
||||||
|
mem_profiler_chan.clone(),
|
||||||
devtools_chan);
|
devtools_chan);
|
||||||
|
|
||||||
SCRIPT_TASK_ROOT.with(|root| {
|
SCRIPT_TASK_ROOT.with(|root| {
|
||||||
|
@ -417,8 +441,17 @@ impl ScriptTaskFactory for ScriptTask {
|
||||||
load_data.url.clone());
|
load_data.url.clone());
|
||||||
script_task.start_page_load(new_load, load_data);
|
script_task.start_page_load(new_load, load_data);
|
||||||
|
|
||||||
|
// Register this task as a memory reporter.
|
||||||
|
let reporter_name = format!("script-reporter-{}", id.0);
|
||||||
|
let msg = mem::ProfilerMsg::RegisterReporter(reporter_name.clone(), reporter);
|
||||||
|
mem_profiler_chan.send(msg);
|
||||||
|
|
||||||
script_task.start();
|
script_task.start();
|
||||||
|
|
||||||
|
// Unregister this task as a memory reporter.
|
||||||
|
let msg = mem::ProfilerMsg::UnregisterReporter(reporter_name);
|
||||||
|
mem_profiler_chan.send(msg);
|
||||||
|
|
||||||
// This must always be the very last operation performed before the task completes
|
// This must always be the very last operation performed before the task completes
|
||||||
failsafe.neuter();
|
failsafe.neuter();
|
||||||
}, ConstellationMsg::Failure(failure_msg), const_chan);
|
}, ConstellationMsg::Failure(failure_msg), const_chan);
|
||||||
|
@ -473,6 +506,7 @@ impl ScriptTask {
|
||||||
resource_task: ResourceTask,
|
resource_task: ResourceTask,
|
||||||
storage_task: StorageTask,
|
storage_task: StorageTask,
|
||||||
image_cache_task: ImageCacheTask,
|
image_cache_task: ImageCacheTask,
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
devtools_chan: Option<DevtoolsControlChan>)
|
devtools_chan: Option<DevtoolsControlChan>)
|
||||||
-> ScriptTask {
|
-> ScriptTask {
|
||||||
let runtime = ScriptTask::new_rt_and_cx();
|
let runtime = ScriptTask::new_rt_and_cx();
|
||||||
|
@ -502,6 +536,8 @@ impl ScriptTask {
|
||||||
control_port: control_port,
|
control_port: control_port,
|
||||||
constellation_chan: constellation_chan,
|
constellation_chan: constellation_chan,
|
||||||
compositor: DOMRefCell::new(compositor),
|
compositor: DOMRefCell::new(compositor),
|
||||||
|
mem_profiler_chan: mem_profiler_chan,
|
||||||
|
|
||||||
devtools_chan: devtools_chan,
|
devtools_chan: devtools_chan,
|
||||||
devtools_port: devtools_receiver,
|
devtools_port: devtools_receiver,
|
||||||
devtools_sender: devtools_sender,
|
devtools_sender: devtools_sender,
|
||||||
|
@ -783,6 +819,8 @@ impl ScriptTask {
|
||||||
LiveDOMReferences::cleanup(addr),
|
LiveDOMReferences::cleanup(addr),
|
||||||
ScriptMsg::DocumentLoadsComplete(id) =>
|
ScriptMsg::DocumentLoadsComplete(id) =>
|
||||||
self.handle_loads_complete(id),
|
self.handle_loads_complete(id),
|
||||||
|
ScriptMsg::CollectReports(reports_chan) =>
|
||||||
|
self.collect_reports(reports_chan),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -989,6 +1027,40 @@ impl ScriptTask {
|
||||||
chan.send(ConstellationMsg::LoadComplete(pipeline)).unwrap();
|
chan.send(ConstellationMsg::LoadComplete(pipeline)).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_reports(cx: *mut JSContext, path_seg: String) -> Vec<Report> {
|
||||||
|
let mut reports = vec![];
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
let rt = JS_GetRuntime(cx);
|
||||||
|
let mut stats = ::std::mem::zeroed();
|
||||||
|
if CollectServoSizes(rt, &mut stats) {
|
||||||
|
let mut report = |mut path_suffix, size| {
|
||||||
|
let mut path = path!["pages", path_seg, "js"];
|
||||||
|
path.append(&mut path_suffix);
|
||||||
|
reports.push(Report { path: path, size: size as usize })
|
||||||
|
};
|
||||||
|
|
||||||
|
report(path!["gc-heap", "used"], stats.gcHeapUsed);
|
||||||
|
report(path!["gc-heap", "unused"], stats.gcHeapUnused);
|
||||||
|
report(path!["gc-heap", "admin"], stats.gcHeapAdmin);
|
||||||
|
report(path!["gc-heap", "decommitted"], stats.gcHeapDecommitted);
|
||||||
|
report(path!["malloc-heap"], stats.mallocHeap);
|
||||||
|
report(path!["non-heap"], stats.nonHeap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reports
|
||||||
|
}
|
||||||
|
|
||||||
|
fn collect_reports(&self, reports_chan: ReportsChan) {
|
||||||
|
let mut urls = vec![];
|
||||||
|
for it_page in self.root_page().iter() {
|
||||||
|
urls.push(it_page.document().url().serialize());
|
||||||
|
}
|
||||||
|
let path_seg = format!("url({})", urls.connect(", "));
|
||||||
|
let reports = ScriptTask::get_reports(self.get_cx(), path_seg);
|
||||||
|
reports_chan.send(reports);
|
||||||
|
}
|
||||||
|
|
||||||
/// Handles a timer that fired.
|
/// Handles a timer that fired.
|
||||||
fn handle_fire_timer_msg(&self, id: PipelineId, timer_id: TimerId) {
|
fn handle_fire_timer_msg(&self, id: PipelineId, timer_id: TimerId) {
|
||||||
let page = self.root_page();
|
let page = self.root_page();
|
||||||
|
@ -1287,6 +1359,7 @@ impl ScriptTask {
|
||||||
self.image_cache_task.clone(),
|
self.image_cache_task.clone(),
|
||||||
self.resource_task.clone(),
|
self.resource_task.clone(),
|
||||||
self.storage_task.clone(),
|
self.storage_task.clone(),
|
||||||
|
self.mem_profiler_chan.clone(),
|
||||||
self.devtools_chan.clone(),
|
self.devtools_chan.clone(),
|
||||||
self.constellation_chan.clone(),
|
self.constellation_chan.clone(),
|
||||||
incomplete.layout_chan,
|
incomplete.layout_chan,
|
||||||
|
@ -1429,9 +1502,9 @@ impl ScriptTask {
|
||||||
// We temporarily steal the list of targets over which the mouse is to pass it to
|
// We temporarily steal the list of targets over which the mouse is to pass it to
|
||||||
// handle_mouse_move_event() in a safe RootedVec container.
|
// handle_mouse_move_event() in a safe RootedVec container.
|
||||||
let mut mouse_over_targets = RootedVec::new();
|
let mut mouse_over_targets = RootedVec::new();
|
||||||
mem::swap(&mut *self.mouse_over_targets.borrow_mut(), &mut *mouse_over_targets);
|
std_mem::swap(&mut *self.mouse_over_targets.borrow_mut(), &mut *mouse_over_targets);
|
||||||
document.r().handle_mouse_move_event(self.js_runtime.rt(), point, &mut mouse_over_targets);
|
document.r().handle_mouse_move_event(self.js_runtime.rt(), point, &mut mouse_over_targets);
|
||||||
mem::swap(&mut *self.mouse_over_targets.borrow_mut(), &mut *mouse_over_targets);
|
std_mem::swap(&mut *self.mouse_over_targets.borrow_mut(), &mut *mouse_over_targets);
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyEvent(key, state, modifiers) => {
|
KeyEvent(key, state, modifiers) => {
|
||||||
|
|
|
@ -13,6 +13,9 @@ path = "../msg"
|
||||||
[dependencies.net_traits]
|
[dependencies.net_traits]
|
||||||
path = "../net_traits"
|
path = "../net_traits"
|
||||||
|
|
||||||
|
[dependencies.profile_traits]
|
||||||
|
path = "../profile_traits"
|
||||||
|
|
||||||
[dependencies.util]
|
[dependencies.util]
|
||||||
path = "../util"
|
path = "../util"
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ extern crate ipc_channel;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
extern crate msg;
|
extern crate msg;
|
||||||
extern crate net_traits;
|
extern crate net_traits;
|
||||||
|
extern crate profile_traits;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
extern crate util;
|
extern crate util;
|
||||||
extern crate url;
|
extern crate url;
|
||||||
|
@ -32,6 +33,7 @@ use msg::webdriver_msg::WebDriverScriptCommand;
|
||||||
use net_traits::ResourceTask;
|
use net_traits::ResourceTask;
|
||||||
use net_traits::image_cache_task::ImageCacheTask;
|
use net_traits::image_cache_task::ImageCacheTask;
|
||||||
use net_traits::storage_task::StorageTask;
|
use net_traits::storage_task::StorageTask;
|
||||||
|
use profile_traits::mem;
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::sync::mpsc::{Sender, Receiver};
|
use std::sync::mpsc::{Sender, Receiver};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
@ -190,6 +192,7 @@ pub trait ScriptTaskFactory {
|
||||||
resource_task: ResourceTask,
|
resource_task: ResourceTask,
|
||||||
storage_task: StorageTask,
|
storage_task: StorageTask,
|
||||||
image_cache_task: ImageCacheTask,
|
image_cache_task: ImageCacheTask,
|
||||||
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
devtools_chan: Option<DevtoolsControlChan>,
|
devtools_chan: Option<DevtoolsControlChan>,
|
||||||
window_size: Option<WindowSizeData>,
|
window_size: Option<WindowSizeData>,
|
||||||
load_data: LoadData);
|
load_data: LoadData);
|
||||||
|
|
5
components/servo/Cargo.lock
generated
5
components/servo/Cargo.lock
generated
|
@ -648,7 +648,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js"
|
name = "js"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/rust-mozjs#f59c04795c84b82e00fdbd694bed90c56fa6567a"
|
source = "git+https://github.com/servo/rust-mozjs#9509978ed1e767c6cbf3da1886ab618f3fa58585"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -821,7 +821,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mozjs_sys"
|
name = "mozjs_sys"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
source = "git+https://github.com/servo/mozjs#2c918d1fb803673f5e5aca230034f77e85455448"
|
source = "git+https://github.com/servo/mozjs#065c9a4268ae51288e946b9dbf1c233f1dcf5ca3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "msg"
|
name = "msg"
|
||||||
|
@ -1178,6 +1178,7 @@ dependencies = [
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"msg 0.0.1",
|
"msg 0.0.1",
|
||||||
"net_traits 0.0.1",
|
"net_traits 0.0.1",
|
||||||
|
"profile_traits 0.0.1",
|
||||||
"serde 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -111,8 +111,8 @@ impl Browser {
|
||||||
let constellation_chan = create_constellation(opts.clone(),
|
let constellation_chan = create_constellation(opts.clone(),
|
||||||
compositor_proxy.clone_compositor_proxy(),
|
compositor_proxy.clone_compositor_proxy(),
|
||||||
time_profiler_chan.clone(),
|
time_profiler_chan.clone(),
|
||||||
devtools_chan,
|
|
||||||
mem_profiler_chan.clone(),
|
mem_profiler_chan.clone(),
|
||||||
|
devtools_chan,
|
||||||
supports_clipboard);
|
supports_clipboard);
|
||||||
|
|
||||||
if let Some(port) = opts.webdriver_port {
|
if let Some(port) = opts.webdriver_port {
|
||||||
|
@ -157,8 +157,8 @@ impl Browser {
|
||||||
fn create_constellation(opts: opts::Opts,
|
fn create_constellation(opts: opts::Opts,
|
||||||
compositor_proxy: Box<CompositorProxy+Send>,
|
compositor_proxy: Box<CompositorProxy+Send>,
|
||||||
time_profiler_chan: time::ProfilerChan,
|
time_profiler_chan: time::ProfilerChan,
|
||||||
devtools_chan: Option<Sender<devtools_traits::DevtoolsControlMsg>>,
|
|
||||||
mem_profiler_chan: mem::ProfilerChan,
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
|
devtools_chan: Option<Sender<devtools_traits::DevtoolsControlMsg>>,
|
||||||
supports_clipboard: bool) -> ConstellationChan {
|
supports_clipboard: bool) -> ConstellationChan {
|
||||||
let resource_task = new_resource_task(opts.user_agent.clone(), devtools_chan.clone());
|
let resource_task = new_resource_task(opts.user_agent.clone(), devtools_chan.clone());
|
||||||
|
|
||||||
|
|
5
ports/cef/Cargo.lock
generated
5
ports/cef/Cargo.lock
generated
|
@ -640,7 +640,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js"
|
name = "js"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/rust-mozjs#f59c04795c84b82e00fdbd694bed90c56fa6567a"
|
source = "git+https://github.com/servo/rust-mozjs#9509978ed1e767c6cbf3da1886ab618f3fa58585"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -813,7 +813,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mozjs_sys"
|
name = "mozjs_sys"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
source = "git+https://github.com/servo/mozjs#2c918d1fb803673f5e5aca230034f77e85455448"
|
source = "git+https://github.com/servo/mozjs#065c9a4268ae51288e946b9dbf1c233f1dcf5ca3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "msg"
|
name = "msg"
|
||||||
|
@ -1150,6 +1150,7 @@ dependencies = [
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"msg 0.0.1",
|
"msg 0.0.1",
|
||||||
"net_traits 0.0.1",
|
"net_traits 0.0.1",
|
||||||
|
"profile_traits 0.0.1",
|
||||||
"serde 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
5
ports/gonk/Cargo.lock
generated
5
ports/gonk/Cargo.lock
generated
|
@ -574,7 +574,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js"
|
name = "js"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/rust-mozjs#f59c04795c84b82e00fdbd694bed90c56fa6567a"
|
source = "git+https://github.com/servo/rust-mozjs#9509978ed1e767c6cbf3da1886ab618f3fa58585"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -739,7 +739,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mozjs_sys"
|
name = "mozjs_sys"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
source = "git+https://github.com/servo/mozjs#2c918d1fb803673f5e5aca230034f77e85455448"
|
source = "git+https://github.com/servo/mozjs#065c9a4268ae51288e946b9dbf1c233f1dcf5ca3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "msg"
|
name = "msg"
|
||||||
|
@ -1058,6 +1058,7 @@ dependencies = [
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"msg 0.0.1",
|
"msg 0.0.1",
|
||||||
"net_traits 0.0.1",
|
"net_traits 0.0.1",
|
||||||
|
"profile_traits 0.0.1",
|
||||||
"serde 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue