aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-05-26 00:08:42 -0500
committerbors-servo <lbergstrom+bors@mozilla.com>2016-05-26 00:08:42 -0500
commit5a81470c4db563fce4f84949507b25206b0dbedb (patch)
treed2b7f74f9eb02d82c19c6d9e58be56918588490b /components/script/script_thread.rs
parentedf121324e475270f56f539900ff24f9005f3fdb (diff)
parent7536afff2a8cd77fd5d0ae6b3324a430eae8ae67 (diff)
downloadservo-5a81470c4db563fce4f84949507b25206b0dbedb.tar.gz
servo-5a81470c4db563fce4f84949507b25206b0dbedb.zip
Auto merge of #11372 - tschneidereit:parent-js-runtime-for-workers, r=nox
Pass a parent JS runtime when creating DOM Worker runtimes This enables sharing data with the parent runtime, decreasing memory usage and startup time. Also contains an update to current rust-mozjs, because that's required for this to work. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [x] These changes don't fix a github issue Either: - [ ] There are tests for these changes OR - [x] These changes do not require tests because the changes don't change any observable behavior <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11372) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 24172ab900f..8b87dcb2169 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -87,6 +87,7 @@ use std::borrow::ToOwned;
use std::cell::{Cell, RefCell};
use std::collections::HashSet;
use std::option::Option;
+use std::ptr;
use std::rc::Rc;
use std::result::Result;
use std::sync::atomic::{Ordering, AtomicBool};
@@ -443,8 +444,8 @@ impl ScriptThreadFactory for ScriptThread {
let mem_profiler_chan = state.mem_profiler_chan.clone();
let window_size = state.window_size;
let script_thread = ScriptThread::new(state,
- script_port,
- script_chan.clone());
+ script_port,
+ script_chan.clone());
SCRIPT_THREAD_ROOT.with(|root| {
*root.borrow_mut() = Some(&script_thread as *const _);
@@ -519,7 +520,7 @@ impl ScriptThread {
port: Receiver<MainThreadScriptMsg>,
chan: Sender<MainThreadScriptMsg>)
-> ScriptThread {
- let runtime = unsafe { new_rt_and_cx() };
+ let runtime = unsafe { new_rt_and_cx(ptr::null_mut()) };
unsafe {
JS_SetWrapObjectCallbacks(runtime.rt(),